June 20, 2014 at 4:39 am
Hi,
I have a maintenance plan which rebuilds indexes on ALL databases on my instance. I'm running SQL Server 2008 R2 and it is fully up to date with it's service pack and CU.
It completes successfully within a minute or two but the next morning when I check, indexes are still heavily fragmented.
I manually rebuilt an index which was 99% fragmented and it has rebuilt it successfully.
But when my rebuild index maintenance plan runs it seems to ignore these fragmented indexes.
This is happening for clustered and non-clustered indexes.
Any help much appreciated.
June 20, 2014 at 4:43 am
You're not looking at heaps, are you? Those won't be affected.
June 20, 2014 at 4:52 am
Yes I do have heap tables on there but I just manually rebuilt an index for the MSDB database which was 99% fragmented.
This particular index in MSDB wasn't defragmented using my maintenance plan.
June 20, 2014 at 5:20 am
check the size of the table; small tables under something like 1000 pages of data will not be affected by a reindex. that could be what you are seeing: small tables with 99% fragmentation, which is normal;
Lowell
June 20, 2014 at 5:21 am
Really small table?
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
June 20, 2014 at 7:27 am
The table in msdb is 6828MB.
Row count is 6385.
How would I work out if it's less than 1000 data pages?
June 20, 2014 at 9:21 am
zedtec (6/20/2014)
Hi,I have a maintenance plan which rebuilds indexes on ALL databases on my instance. I'm running SQL Server 2008 R2 and it is fully up to date with it's service pack and CU.
It completes successfully within a minute or two but the next morning when I check, indexes are still heavily fragmented.
I manually rebuilt an index which was 99% fragmented and it has rebuilt it successfully.
But when my rebuild index maintenance plan runs it seems to ignore these fragmented indexes.
This is happening for clustered and non-clustered indexes.
Any help much appreciated.
Does your maintenance plan also have a "shrink" in it?
--Jeff Moden
Change is inevitable... Change for the better is not.
June 20, 2014 at 9:22 am
It used to until recently but not any more.
June 20, 2014 at 9:58 am
zedtec (6/20/2014)
It used to until recently but not any more.
Ok. So when did you take that out and have you checked other jobs to make sure that none of them have DB Shrinks in them?
The other things to check are...
1. Is there an overnight job that repopulates or causes massive updates to the tables in question?
2. Are the clustered indexes on columns that are unique, narrow, not null, and ever-increasing?
3. Check the settings on the database... is it set for "autoshrink"?
--Jeff Moden
Change is inevitable... Change for the better is not.
June 20, 2014 at 10:17 am
I took the shrink out 2 days ago.
Only one maintenance plan had the shrink. I have checked all of the maintenance plans since and they are all completing successfully including the index rebuild.
Auto shrink is not taking place.
Auto growth is taking place for the data and log files for all the databases.
As far as I know the clustered indexes are unique and not null.
June 20, 2014 at 10:20 am
Also to add to that, index rebuilds were not taking place up to now.
Added this in when the shrink was taken out.
There aren't any overnight processes taking place which update the databases.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply