get_top_cached_queries
Retrieve top cached SQL statements from Azure SQL Database, showing execution counts, CPU time, and logical reads. Pinpoint resource-intensive queries for performance tuning.
Instructions
Get top cached statements from sys.dm_exec_query_stats. Returns bounded text previews and plan-cache metrics without raw plan XML.
Tool call template
This tool declares no required parameters. Add optional parameters from the input schema as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {},
"name": "get_top_cached_queries"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| limit | No | Maximum cached queries to return. | |
| sort_by | No | Sort by execution_count, total_worker_time, avg_worker_time, total_elapsed_time, avg_elapsed_time, total_logical_reads, total_physical_reads, or total_logical_writes. | total_worker_time |
| database_name | No | Optional database name. Defaults to AZURE_SQL_DEFAULT_DATABASE. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||