rebuilding indexes vs. updating statistics

  • Simply put, what are the benefits of doing one over the other.

    I favor updating statistics, but I have seen one instance where dropping an index and recreating it made a difference. It made a called stored procedure work better. To be honest I was lost in that when I execute an sp in QA the sp was fine - when it was called from a Clarify application the retrieval went out the door. I update the statistics on my indexes nightly, yet when I dropped and rebuilt the index the results from QA were the same but the application now retrieved the data in the same time as the QA.

    Does anybody have a single article which compares these functions and gives a sound recommendatation?

    John Zacharkan


    John Zacharkan

  • One of the reasons to rebuild the indexes is to eliminate or to minimize fragmentation. In your case, it sounds like different execution plans are being used when the sp executes, when you rebuilt the index the application chose a different execution plan which happens to now be the most optimal. You could use sql_profiler to see what code is actually being sent to the server when the code is executed. Remember fully qualified names are good to use when executing sql and sp's.

    Hope this helps

    Tom Goltl

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply