Category: Editorial

  • More Than SQL

    SQL Saturday #52I am speaking at the upcoming SQL Saturday #52 – Colorado in the Denver Tech Center in a little over a week. I’m doing a presentation on The Modern Resume and a short mini-keynote talk at lunch time, and I’m joined by some amazing speakers, like Kevin Cox from the SQL CAT team, User group President Marc Beacom, and local MVPs Glenn Berry, Paul Nielsen, and Chris Shaw. We have some amazing people coming from out of town like Jack Corbett from Florida and Tim Mitchell from Texas, and Jason Strate from Miinesota. It’s a fantastic lineup with many more talented speakers and the chance for you to get a free day of world class training on things important to your career as a data professional.

    Those of us speaking are doing our part to give back to the SQL community, which is an amazing group of people that not only strive to be better at their jobs, but also engage and interact with one another, sharing that knowledge. I’ve learned a lot from many of these people, and hope that I can teach a little bit as well.

    However at this SQL Saturday, we are giving everyone the chance to do more than just learn about SQL. You can give back to this local community as well. We will be accepting donations of food that speakers will distribute back to the community food banks and victims of the fire near Boulder in Four Mile Canyon.

    There is more to life than our work. The SQL community is here to help you with your career, and we are happy to do that. This is a great way of also looking to give back to the local community in a way that I hope catches on at other events.

    Steve Jones

  • Searching for Plans

    I was re-reading Conor Cunningham’s “Does Join Order Matter?” recently and found this quote in the post that stood out. As an aside, read this post. It’s fantastic.

    “…SQL Server’s QP is actually not set up to give you the best plan.  Instead, it is set up to give you a good enough plan quickly (where good enough is very close to “best”).”

    I get that, and it makes sense. Why spend 4 hours optimizing a query that runs in 2 minutes to get it down to 1:50 (Conor’s example) when the optimizer can spend 1 sec and have it execute in those two minutes. If the optimizer looked for the best plan, I’d be very angry as a customer. Especially if this happened with any frequency.

    Or would I?

    I’m not suggesting that we ought to optimize every query, or that I’d prefer the optimizer didn’t try to normalize queries, or that I want to see the internal tree and try to figure out if I can rewrite the query. I might, however, want to do that for some queries. There are queries that I might want to find the “best” plan for, either because they take a long time to run, or they are run often. I could then use that in something like a USE PLAN.

    Computers are cheap these days, as is disk. If I were to somehow able to copy my database onto an instance of SQL Server on a cheap PC, wouldn’t it be cool if I could set that optimizer loose on my query and let it try ALL possible plans? I’d be happy if it spent that 4 hours and gave me back an optimal plan that I could carry back over to my expensive, busy server, and shave that 10sec off a query that I run 10,000 times a day.

    I could see some value in a “test” instance of SQL Server that just looked for optimal plans. Now if I could just get Microsoft to build it.

    Steve Jones

  • Instrumentation

    In a discussion recently someone mentioned that they built in timing mechanisms into their application so they were aware of how long certain modules or functions were executing. Using this data, they could easily determine if the system was performing poorly by comparing the average of timings to the current performance.

    I thought that was a great idea, and it shows some proactive, forward thinking on the part of the developer. I haven’t often seen this in SQL Server, though it does seem that many good DBAs maintain some type of overall baseline for their database servers in order to help them response to performance issues.

    For a Friday poll, I was curious how many of you actually think about monitoring your systems. I decided to ask this in a general way to get an idea of what others might be doing inside SQL Server as well as in the applications that connect to SQL Server.

    Do you build instrumentation into your applications and code to measure the performance?

    I’m wondering if you actually collect, log, and even analyze data on how long processes take, or how much data you work with. Do you capture row counts from data loads or processing? Do you maintain an average time for code to execute?

    I haven’t done a lot of this in code. There was one application which watched for files and loaded them every day. We built code into SQL Server that tracked how long the load took, and how many rows were processed, mostly as a way to prepare for future hardware upgrades. As a production DBA, I have typically kept an average on size and time of backups for the same reason. It helps me capacity plan, and alerts me to growing loads for the server.

    If you do anything differently, or if you’ve found this to be valuable, or even a waste of time, let us know this Friday.

    Steve Jones

  • Enjoy Your Job

    I was listening to Mike and Mike on the radio a few Mondays ago and Mike Greenberg was returning on a Monday morning after being gone for a week’s vacation. He mentioned that he was happy to return to work and looked forward to it. Not that he didn’t enjoy vacation, but he likes his job and said he was thankful that he didn’t have a job that he dreaded returning to after time off.

    That’s how I feel, and it’s how I’ve tried to pick my jobs over the last decade or so. That wasn’t always the case, and early in my career I picked jobs that would be good for me growth and development, would pay me more, or provide some exciting challenge. I was willing to put up with long hours, or lots of demands from the company. I even took jobs with people that I didn’t like, or wouldn’t bother to ever socialize with.

    These days I feel differently, and the advice that I’ve given to people lately is “Don’t take a crappy job.” You can define that however you like, but I’d really think hard about whether you’d look forward to going to work. Whether it’s the people you want to meet or the challenges of doing the work you do, I hope that you do look ahead positively and not with trepidation.

    Life is short, and remember that when you pick the place and position where you’ll spend a lot of time in the future.

    Steve Jones