I tried to use Azure SQL Performance metrics and for me they are running very slow and consume lots of CPU (up 100%).
Example takes 4 minutes to execute, CPU 100%
SELECT * FROM sys.resource_stats WHERE database_name = 'db1' AND start_time > DATEADD(day, -7, GETDATE())
Example instant, CPU 80%
SELECT end_time, avg_cpu_percent FROM sys.dm_db_resource_stats
I want to monitor DB as often as possible, but these monitoring queries kill all statistics.
- Any ideas why it might take so long?
- Are there any other ways to get stats from Azure SQL?