A couple more questions from the last couple of classes. Q1) Why doesn’t performing an index rebuild alter the fragmentation? A1) Here are the possibilities – all of which I’ve seen happen: Q2) What operations take advantage of minimal-logging when the recovery mode is BULK_LOGGED? A2) The list is very small – 4 four classes of operations: For these operations, only the allocations are logged in the transaction log. Any extents that are allocated and changed through a minimally-logged operation are marked in the ML bitmaps (one for every 4GB of each file) and then the next transaction log backup will also read all those extents and include them in the backup.
Summer School Savings SALE is live!
Happy Fourth of July to all who celebrate! I’m looking forward to a great view Thursday evening looking west along the Skagit Valley with some
5 thoughts on “Conference Questions Pot-Pourri #3: unexpected index rebuild results and bulk-logged operations”
I am reading this blog again and again in order to understand what counter I have to use to figure out the fragemenation. The database I am dealing has multiple files and all indexes are spread acrosss multiple files (we being told that I/0 path are very different for each file.)
Let me repeate again that for my case all I have to concentrate is Logical Fragementation counter if tables is not heap!! am I correct or I need look at others counter also.
Is logical fragemenation > 30 is good criteria ?
Thanks.
Yup – correct on both counts (as a generalization). Your mileage may vary though…
I have some large tables where oneline rebuilds is not defragmenting index_level 1, although there are thousands of pages at that level. It looks like all I’m getting is some compaction on pages. It seems like this type of fragmenation in index_level 1 must be a problem, is that correct?
Here’s an example:
Table index_depth=4
**Before online rebuild
Clustered index:
Index_level 0 (leaf) –
avg_fragmentation_in_percent = 0.1
page_count = 1,041,444
avg_page_space_used_in_percent = 91
Index_level 1 –
avg_fragmentation_in_percent = 93
page_count = 5,643
avg_page_space_used_in_percent = 93
*******************
***After online rebuild
Index_level 0 (leaf) –
avg_fragmentation_in_percent = 0.0
page_count = 1,041,932
avg_page_space_used_in_percent = 91
Index_level 1 –
avg_fragmentation_in_percent = 98.7
page_count = 5,590
avg_page_space_used_in_percent = 94
Paul: Here alter table rebuild on heap will remove forwarded records so in this case we can say fragmentation removed.is it right?
If you describe forwarded records as heap fragmentation, then yes.