SELECT index_type_desc,object_id, avg_fragmentation_in_percent FROM sys.dm_db_index_physical_stats(5,prod,Lauotse, uyrti , 'DETAILED')where index_type_desc='CLUSTERED INDEX' and avg_fragmentation_in_percent>20;
I have database on which I am running it which is very big around 500 gb and it have very few tables and are very big in size.
When I run this It locks the database for 5 minutes the main production,Is there any way to get it fast?
Thanks