Index fragmentation, part 2

Does fragmentation hurt? Checkout my earlier post in this series http://sqlblog.karaszi.com/does-index-fragmentation-matter/.  [EDIT] Some of the conclusions in this post turned out to be invalide, due to auto-update statistics kicking in. Check out the final post: http://sqlblog.karaszi.com/fragmentation-the-final-installment/ In my last blog post, I wanted to focus on the sequential vs random I/O aspect and how that […]

Does index fragmentation matter?

Short answer: probably not. [Edit] I suggest you also check out the final post in this series: http://sqlblog.karaszi.com/fragmentation-the-final-installment/ [Edit 2] Because of the flood of spam, I’ve closed comments on this. Please comment o the final installment post instead. Long answer: read on. You know the story. Every week or so, we defragment the indexes. […]

Find table and index name for fragmented indexes

Got this question from a newsgroup today. The answer is pretty simple, just use the dynamic management view sys.dm_db_index_physical_stats. I’m posting this here mostly so I have somewhere to refer to when asked this question… I prefer to have a helper function to get the index name: CREATE FUNCTION dbo.index_name (@object_id int, @index_id int) RETURNS sysname AS BEGIN RETURN(SELECT name FROM sys.indexes WHERE object_id = @object_id and index_id = @index_id) END; GO And […]