One 400GB table, One query - Need Tuning Ideas (SQL2005)

后端 未结 24 2125
予麋鹿
予麋鹿 2021-01-30 15:03

I have a single large table which I would like to optimize. I\'m using MS-SQL 2005 server. I\'ll try to describe how it is used and if anyone has any suggestions I would appreci

24条回答
  •  死守一世寂寞
    2021-01-30 15:47

    First off, spend a day with SQL Profiler running in the background. At the end of the day, save the trace data to a file and have the Optimization wizard pour over it and evaluate your current index. That should tell you if changing the indexed fields, sort order, etc. can give you any significant gains. Do not let the wizard make the changes. If the percentage performance gain looks significant (> 30% IMHO), go ahead and make the change yourself.

    Your index has to be getting on the large side. You may want to schedule a job (overnight, a couple times a week) to do the following:

    • Move data over a certain age to a history table
    • defrag the index
    • recalculate metrics

    That will keep it speedy once you have tuned the indexes.

提交回复
热议问题