June 15, 2009 at 5:51 am
Hello
I have created some tasks for our SQL server, I wanted to check that I have them setup correctly. They run weekly over the weekend. I use SQL for Sharepoint and SAGE (Companies accounting software)
Backups are not a problem
Image is attached (I created it in SQL Management Studio as my SQL writing abilities are limited to SELECT!)
Thank you
June 15, 2009 at 5:58 am
Do the update stats before the rebuild/reorg. Reason is that an index rebuild will update stats will full scan, so if you do a sampled update after that you end up with less accurate stats then if the update stats hadn't been there.
With stats update before index rebuild, all stats get updated sampled and then those associated with indexes get an update with full scan. Best of both worlds.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 15, 2009 at 5:59 am
Thanks for that
Callum
June 25, 2009 at 10:03 am
Your best bet is to use an existing index rebuild script that checks the fragmentation levels of the indexes and only rebuilds ones that are fragmented more than a specific threshold, then does a re-org on the others and updates the stats for the ones that are only re-orged. There are several of them available, I use the one written by Andrew Kelley and published in SQL Server magazine.
You can also use sp_updatestats because in SQL 2005, they modified it to only update statistics that need to be updated which should ignore any that were just modified because of an index rebuild.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply