mssql_top_queries
Identify the most resource-intensive queries from the SQL Server plan cache. Rank by CPU, duration, reads, writes, memory, or executions to start performance tuning.
Instructions
Find the most expensive queries from the plan cache, ranked by a chosen metric: cpu, duration, reads (logical I/O), writes, memory (grant size), or executions. Returns per-query totals and averages with the SQL text — the starting point for performance tuning.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| top | No | Number of queries to return (default: 10, max: 50) | |
| metric | No | Ranking metric (default: cpu) | cpu |
| response_format | No | Response format (default: markdown) | markdown |