Thursday, April 28, 2011

Time Spent, Time Wasted

Sometimes tuning a database can be rewarding.  I get great satisfaction when helping a user take their query from 10 minutes down to 3 seconds.  But it doesn't always work that way.  Consider this recent exchange:

Developer to DBA Manager: The database is slow.
DBA Manager to DBA: Trace his process.

The DBA traces the developer's process and comes up with about 12 queries that can benefit from tuning.  The DBA informs both the developer and the DBA Manager that he thinks these 12 queries could benefit from some attention.

Developer to DBA Manager: We don't have time to tune our own queries, we need one of your DBAs to do it for us.
DBA Manager to Developer: But you guys know the model, my guys will end up asking you 100 questions.
Developer to DBA Manager: That's fine, we don't have time to work on it.
DBA Manager to DBA: Start working on tuning the queries.


DBA spends 6 days tuning the 12 queries.  Some of the queries require the SQL to change, some require statistics to be gathered at a different point, and some are just changing how the indexes work.  The DBA informs both the DBA Manager and the developer what needs to change and how exactly to implement the changes from the database perspective.

Almost two weeks pass and the developer is back in the DBA Manager's office:

Developer to DBA Manager: The database is slow.
DBA Manager to Developer: Did you make the changes we recommended?
Developer to DBA Manager: We don't have time to make the changes, can't you just make the database go faster.
DBA Manager to Developer: Please get your management to approve us spending a boatload of money on new hardware and Oracle licenses.

7 comments:

Noons said...

Wanna bet someone will be outsourced to pay for the extra hardware and it will NOT be the duhvelopers?

chris_c said...

Oracle being so cheap and all, just throw hardware at the problem untill it is fixed. Or you go out of business becuase Larry has all your money.

kevinclosson said...

I like this post.

May I ask, however, why the first question from the DBA Manager wasn't to try to quantify what "slow" means?

Jeff Hunter said...

@kevinclosson: The conversation was paraphrased to make a point.

kevinclosson said...

I know Jeff, but I'm making a point too.

Joel Garry said...

Doesn't tracing a process quantify slow?

word: catinesc

symptoms said...

On a couple of my websites, I need to tune my databases which I'm not looking forward to because its going to be tough.