Follow

Profiling queries to Azure SQL DB

When using Azure SQL DB with TimeXtender, you may query sys.query_store_query_text system catalog view which contains the Transact-SQL text.  An example is shown below:

SELECT TOP 100
                qt.query_sql_text As [Query Text]
              , q.query_id As [Query Id]
              , qt.query_text_id As [Query Text Id]
              , p.plan_id As [Plan Id]
              , SwitchOffset(rs.last_execution_time, '-05:00') As [Last Execution Time]
FROM   sys.query_store_query_text AS qt
INNER JOIN sys.query_store_query AS q ON qt.query_text_id = q.query_text_id
INNER JOIN sys.query_store_plan AS p ON q.query_id = p.query_id
INNER JOIN sys.query_store_runtime_stats AS rs ON p.plan_id = rs.plan_id
ORDER BY rs.last_execution_time DESC;
Below is an example output.
2021-01-13_15h34_47.png
For more information, review Microsoft documentation:
Was this article helpful?
0 out of 0 found this helpful

0 Comments

Please sign in to leave a comment.