Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Rebuild and organize indexes based on page_count Expand / Collapse
Author
Message
Posted Tuesday, February 19, 2013 1:58 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, May 03, 2013 8:54 AM
Points: 113, Visits: 890
Hi all,
I have a job weekly, it runs on Sunday. The purpose is REBUILD/REORGANIZE all indexes in my database.

If avg_fragmentation_in_percent > 5 and <=30% Then REORGANIZE
If avg_fragmentation_in_percent > 30% Then REBUILD

However, I saw the several indexes are not impacted by this job. I know that SQL engine will not do anything in case page_count of an index is small. But does anyone know what threshold of page_count SQL Engine will use to rebuil/reorganize indexes?

In my case, I have a index

TableName | IndexName | avg_fragmentation_in_percent | page_count
ProductPromotion | PK_ProductPromotion | 58.33333333 | 12

Thanks,
Post #1421479
Posted Tuesday, February 19, 2013 2:12 AM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 12:59 PM
Points: 37,640, Visits: 29,895
The SQL engine has no such threshold (well, other than it can't rebuild a 1 page index). Even with 2 it will run the rebuild/reorg. Probably won't have much if any effect, but it will run it.


Gail Shaw
Microsoft Certified Master: SQL Server 2008, MVP
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass

Post #1421481
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse