In the post
it was suggested that index fragmentation on user tables should be ignored unless the index required more than 1000 pages. I am trying to setup a query to test for this condition. Is this correct?
select
DB_NAME(Ips.database_id) as DBName ,
'Index Name' as IndexName
from sys.dm_db_index_physical_stats(Ips.database_id, NULL, NULL, NULL , 'DETAILED') as Ips
join sys.indexes as SysI
on (Ips.index_id = SysI.index_id)
where Ips.avg_fragmentation_in_percent > 60 ' my magic number
and (Ips.fragment_count * Ips.avg_fragment_size_in_pages > 1000)
TIA,
edm2