Solved

Index Rebuild or Index Defrag?

Posted on 2009-05-11
3
454 Views
Last Modified: 2012-08-13
I have DBs that have indexes that are fragmented in various levels from 30% to 99% because index maintenance was never scheduled/ created.  I know that it is easier to INDEXDEFRAG than to Rebuild the INDEX (Less time and no long term locks on the table), but there must me a specific point where rebuilding would be better than tryig to defrag the index.  (I know that rebuilding would need to be done in non-production hours or late at night).  But I want to set up a process that checks the fragmentation of an index and if the %of fragmentations is over a specific amount, set that index for rebuilding and if it is less than a specifi % set the index for defraging.   Does anyone have an idea where / what that % might be?  (Lets use a simple index of one column with 500K records as an example).

Thanks in advance
0
Comment
Question by:blberger
3 Comments
 
LVL 16

Expert Comment

by:SQL_SERVER_DBA
Comment Utility
0
 
LVL 13

Accepted Solution

by:
St3veMax earned 500 total points
Comment Utility
Some say....That if the fragmentation is > 30% the re-index; otherwise Rebuild.

HTH
0
 

Author Closing Comment

by:blberger
Comment Utility
Thank you for a direct answer.  I have read the article pointed out by the other response, but it did not give me the threshold value.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now