Quantcast
Viewing all articles
Browse latest Browse all 15889

Index fragmentation and ghost leaf relationship

From what I understood, when a row is deleted, SQL engine only logically deletes the row by marking the record as ghosted. Then at some point the background ghost cleanup task will remove the slot for that record so then that space can be utilized again. But based on Paul Randal's post "On big systems it's possible for the ghost cleanup process to fall behind the rest of the system, with no hope of it catching up".

The avg_fragmentation_in_percent column returned by sys.dm_db_index_physical_stats shows the logical fragmentation of an index which basically means the next physical page allocated to the index is not the page pointed to by the next-pointer in the current leaf.


my question are:
- What is the relationship between index fragmentation and number of ghost pages in a index?
- Will the ghost page create index fragmentation once it has pages that only contains ghost records?
- Would a high number of ghost pages corrupt an index to a point that queries to that table will get "stuck" waiting for the index resource?


Viewing all articles
Browse latest Browse all 15889

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>