WHEN ips.avg_fragmentation_in_percent > 30 THEN 'REBUILD' WHEN ips.avg_fragmentation_in_percent > 10 THEN 'REORGANIZE' ...
// sys.dm_db_index_physical_stats (SAMPLED mode) for a given database and // returns rows where avg_fragmentation >= 5% AND page_count >= 100. // IndexFragmentationCollector fetches fragmentation ...