Not all indexes get rebuilt or reogranized
Why when some indexes have 99% fragmentation the index optimize script doesnt rebuild it ? It is a WEB edition meaning no online rebuild, would this be the issue ?
With kind regards, Alen
Hi Alen,
Could you please provide the arguments you used when this behavior occurred? It is difficult to answer your question without knowing more. To give you just one example, the default value for the parameter "MinNumberOfPages" is 1000, which means that indexes with fewer than 1000 pages will be skipped.
Best, Danilo
Hi,
I might be having the same problem. I ran this very useful tool against a database with 100's of tables to Reorganise all the fragmented indexes. It appears to have skipped all the Primary Key indexes which were fragmented. It did every other index. I ran the following parameters, on Standard Edition.
EXECUTE dbo.IndexOptimize @Databases = 'ADatabaseName', @FragmentationLow = NULL, @FragmentationMedium = Null, @FragmentationHigh = 'INDEX_REORGANIZE', @FragmentationLevel1 = 5, @FragmentationLevel2 = 50, @LogToTable = 'Y'
From the limited investigation I did, it appears to be all Primary Key were ignored. Will keep investigating.
Running the Reorganise ALL manually on each table, defrags them, would be super awesome, if this tool did too.
Thanks.
MinNumberofPages
Yup this was the key. Thanks.
@alenloncaric, were you able to get this working using @MinNumberOfPages = 0?
I'm closing this issue for now. If you encounter the problem again, feel free to comment and I'll reopen it.