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 2005 Forums
 SQL Server Administration (2005)
 Index maintanance

Author  Topic 

learntsql

524 Posts

Posted - 2009-12-16 : 00:04:33
Hi..
Today I created some indexes in my Production server
what type of maintanance should i take on this?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-16 : 00:06:11
Update stats and rebuilding indexes comes to mind. What is your intention?

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

learntsql

524 Posts

Posted - 2009-12-16 : 00:57:47
Thnaks Tara,
Its the time to me to prepare a check list for index maintanance like
1.Update Stats,Rebuild/ReOrganize Index,Drop unused index and things like these
2.How frequent should i do all/some of these?
Or even if more.
TIA.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-16 : 10:58:43
I rebuild all indexes with >50% fragmentation every day. I also run update stats every day (sp_updatestats).

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

learntsql

524 Posts

Posted - 2009-12-16 : 23:34:31
Should i blindly run rebuild index or any measurments do i follow?
Any Script for rebuild index?.
Any how i have to go through BOL once for better understand.
TIA.
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-16 : 23:40:50
You should do it based upon fragmentation.

Here's the custom script that I wrote and use on all of my systems: http://weblogs.sqlteam.com/tarad/archive/2009/11/03/DefragmentingRebuilding-Indexes-in-SQL-Server-2005-and-2008Again.aspx

I defragment everything >50%.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page

behrman
Yak Posting Veteran

76 Posts

Posted - 2009-12-18 : 09:23:42
May be your indexes can be maintain through reorganize, in such case why u want delete reorganize step it will take less time and less systems resources.
You can maintain it by some calculation on sys.dm_db_index_physical_stats dmv, it is suggested that if your index is fragmented by less then 30 %, u can use reorganize else if it more than 30 % the u should use Rebuild index.

RAQ Report: Web-based Excel-like Java reporting tool
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2009-12-18 : 10:42:07
My script does that, so check it out. My script allows REORGANIZE or REBUILD, and you can pass in the fragmentation level.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog

"Let's begin with the premise that everything you've done up until this point is wrong."
Go to Top of Page
   

- Advertisement -