Index tuning

Topics about Databases, Backups, Tuning, Architecture, Systems Management, etc etc.

Post Reply
bgrenn
Posts: 91
Joined: Mon Mar 16, 2009 11:47 am
Location: Rochester, NY
Contact:

Index tuning

Post by bgrenn »

I learned a valuable lesson today with index tuning.  I was tuning a "process" that looked through old history.. There was an index on widget, but no index on Date.. I figured .. Opportunity to tune the process wahoo.. I added a composite index on widget and date..  My testing of the query showed that the query ran 2x as fast.  Great.  Test the process.. No gain.. After some digging I realized that a query further down the line was reading those rows out of buffer cache.  By adding an index and no longer reading all the rows with the first query, the subsequent query had to do those physical reads.  

Lesson Learned was when tuning a process for physical reads, you need to check for logical reads that would become physical reads with the change.
Post Reply