Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Index Help

Author  Topic 

tooba
Posting Yak Master

224 Posts

Posted - 2012-10-02 : 11:45:36
I am trying to Rebuild and Reorganize index on table. Before i Rebuild/Re Organize Total Fragmentation is 66.67%, but after i Rebuild/Re Organize the Percentage doesn't change ( Total Fragmentation is 66.67%). Is any one can help me or guide me why he doesn't change? and anyone have handy script to Rebuild/Re Organize and update statistics on whole table.

2) Other question its a good idea if i run (Rebuild/Re organize index and Update Statistics on Database) every 30minutes or every day?

Thank You.

lazerath
Constraint Violating Yak Guru

343 Posts

Posted - 2012-10-02 : 12:05:52
It's a good idea to base reorganize / rebuild operations on fragmentation level. In a 24/7/365 applications, you won't want to run this every 30 minutes as rebuilds can introduce blocking depending on your edition. Ideally, you'll want to stagger the job over non-peak hours as appropriate for your needs.

A quick search found http://ola.hallengren.com as a potential script that will intelligently determine if and when you need to update statistics, rebuild or reorganize. I haven't used it before, so I can't vouch for it, but it should get you on the right track.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2012-10-02 : 12:38:32
I can definitely vouch for and recommend Ola's index script, it works very well and is very easy to use.
Go to Top of Page
   

- Advertisement -