Solving Problems at Midnight

I couldn’t sleep last night. I was tossing and turning, struggling to rest, and it seemed I was waking up every 20 minutes.

My demo broke. I have a talk that I’m giving at the Denver SQL Server User Group on Thursday, as practice for the same talk next week at SQL Intersection. After returning from my travels, I fired up my virtual machine on Monday and went through the talk. I’ve given a version of this as recently as 3 weeks ago, but I like to refresh myself. When I got to the third demo, I couldn’t get it to work.

I tried a bunch of things, but the test I was sure would fail, wouldn’t. This is a significant part of my demo, and it shows how data volumes affect things. I reset the snapshot. I dropped and rebuilt the database and process. I even took a 3 hour break, going for a walk, picking up kids, and hitting a yoga class. When I returned at night, while my kids were doing their homework, I couldn’t get mine to work. I even faked the test, and caused a failure, but that wouldn’t work with an audience.

I gave up around 9:30 and went to bed shortly thereafter. At least, I tried to, tossing and turning. My mind was all over the map, thinking about work, some projects at home, kids’ school, etc. At 2am, it hit me. All of a sudden I realized why the test wouldn’t fail. The join that was supposed to be slow, wasn’t, because it was missing some data. I was generating a large volume of data in two of the three tables, but in the third, I hadn’t linked it to my version control system. That’s why it failed.

I don’t always have such great inspiration at night, but I have found that sometimes walking away from an issue and taking a break can help. I’ve even walked to a colleague’s desk and helped them with their own issue, and all of a sudden I realize how to solve my problem. I’ve learned to learn to be productive in other ways when I’m stuck on a particular problem, letting my subconscious mind analyze things in the background.

This morning I linked my table and the test started failing. I have rarely been so happy to see red errors on my monitor.

About way0utwest

Editor, SQLServerCentral
This entry was posted in Blog and tagged , . Bookmark the permalink.