I have AppInsight for SQL Server monitoring one of our production DBs running SQL Server 2012. We have a major issue with index fragmentation on this server and I would like to get statistics for [i]all[/i] indexes, not just the top 10 for each DB. I tried changing the performance counter Top Indexes for Database to retrieve 100 records at the application level. There's two problems with this:
1. It's not elegant. At best this is a hack and I don't want to have to keep an eye on the number of indexes of each database and adjust this according. This is also an issue since the DB is handled by another team. I don't have access to it with my account so I can't easily query it to get this information.
2. More importantly this doesn't work as expected. Despite changing this counter as described in the documentation all the databases still only report the top 10 clustered/non-clustered indexes.
In order to determine the top 10 most fragmented, I imagine SAM needs to get information for all indexes. It seems like there should be a simply way to do this but I cannot find it.
Regards,
-Ben