Resource Usage Report — All SQL Platforms
Use this skill when the user asks about:
- Overall resource usage or performance troubleshooting
- CPU utilization ("why is CPU high?", "is SQL or OS using CPU?")
- Memory pressure ("is there memory pressure?", "what's using memory?")
- Disk space ("how much disk space is left?", "are drives running low?")
- TempDB contention ("is TempDB causing issues?", "PFS/GAM contention")
- Threadpool health ("are we running out of workers?", "thread starvation")
- General slowness ("why is my database slow?", "performance check")
Targets all SQL platforms:
- SQL Server (on-premises, VM, IaaS) — Engine Edition 1–4
- Azure SQL Managed Instance — Engine Edition 8
- Azure SQL Database — Engine Edition 5
- Fabric SQL Database — Engine Edition 12
Unsupported Platforms: Azure Synapse Analytics (Engine Edition 6, 11) and Azure SQL Edge (Engine Edition 9) are not supported. Queries will return an early-exit message on these platforms.
Scope
- Produces an initial resource snapshot, including worker or session limits and thread starvation, to choose the next focused investigation.
- For one identified slow query, use the
slow-query-investigation skill; for a configuration, security, or backup audit, use the health-audit-sqlserver skill.
Azure SQL Database specialization
For Azure SQL Database (EngineEdition 5), read Azure-specific guidance before choosing diagnostic queries. It preserves the service-specific permissions, capture limitations and error interpretation. Keep this skill's scope and authorization rules; the reference is not a second workflow to run unconditionally.
Azure scope and interpretation
Detect the actual platform before selecting DMVs. Azure database resource percentages and instance percentages have different denominators; do not treat them as interchangeable. High memory utilization alone is not proof of memory pressure. Correlate the same time window with waits, worker/session limits and resource-governance evidence; distinguish a governed IO ceiling from storage latency. An empty or permission-denied result is not zero utilization. Local container behavior is not proof of managed-service limits.
After identifying the bottleneck, use investigate-sql-cpu-pressure, investigate-sql-data-io-pressure, investigate-sql-log-io-pressure or investigate-sql-memory-issues for focused diagnosis. A read-only diagnosis does not authorize scaling or configuration changes.
Required tools
- A read-only SQL query tool connected to the target server and database. Prefer, in order: the SQL
Tools MCP server that ships with the
microsoft-sql-admin plugin
(mssql_list_database_connections, mssql_connect_database, then mssql_execute_query); any
other SQL tool the agent host provides for running T-SQL and reading result sets;
sqlcmd from a terminal. If the
SQL Tools MCP server is not connected or lists no connections, follow the sql-tools-mcp-setup
skill, which asks before installing or configuring anything. If no SQL tool can be made available,
give the user the T-SQL to run and ask for the results.
- Least privilege: connect that tool with a diagnostic login that cannot write, for example one that
holds only
VIEW SERVER PERFORMANCE STATE (VIEW SERVER STATE before SQL Server 2022) or, on Azure
SQL Database, VIEW DATABASE PERFORMANCE STATE or ##MS_ServerStateReader##, plus any other read
permission these queries need. A tool is only as read-only as the login it connects with.
Parameters
| Parameter |
Default |
Description |
| TopNClerks |
10 |
Number of memory clerks to display in memory allocation breakdown |
| CPUHighThreshold |
70 |
CPU percentage above which to classify as "HIGH" |
| MemoryHighThreshold |
90 |
Memory percentage above which to classify as "HIGH" |
| DiskFreeWarningPct |
15 |
Free space percentage below which to flag as warning |
| TempDBWaitThresholdMs |
50 |
Minimum wait duration (ms) to include in TempDB contention analysis |
| TempDBHighSeverityMs |
1000 |
Wait duration (ms) above which TempDB contention is classified as HIGH |
| RunnableTasksWarning |
5 |
Runnable tasks count threshold for "THREAD PRESSURE" warning |
| MemoryLowThresholdPct |
10 |
Available memory percentage below which to flag OS memory pressure (SQL Server/MI only) |
| MaxSchedulers |
32 |
Maximum scheduler rows to return in per-scheduler load analysis |
| IncludeTempDBAnalysis |
true |
Whether to run TempDB contention check |
| IncludeThreadpoolHealth |
true |
Whether to run threadpool health analysis |
| IncludeDiskSpace |
true |
Whether to run disk volume free space check (SQL Server/MI only) |
| MaxResults |
20 |
Maximum rows to return per diagnostic section |
Data Collection Steps
Gather all of the following data before generating the report:
Step 0: Detect Platform
- Detect platform — load and execute the Step 0 query from either
references/queries-sqlserver.md or references/queries-azuresql.md
- Based on the
engine_edition result, follow the appropriate path below:
| Engine Edition |
Platform |
Query File |
| 1–4 |
SQL Server (on-prem / IaaS) |
references/queries-sqlserver.md |
| 8 |
Azure SQL Managed Instance |
references/queries-sqlserver.md |
| 5 |
Azure SQL Database |
references/queries-azuresql.md |
| 12 |
Fabric SQL Database |
references/queries-azuresql.md |
| 6, 9, 11 |
Unsupported |
Stop — report unsupported platform |
Path A: SQL Server / Managed Instance (Engine Edition 1–4, 8)
Load and execute queries from references/queries-sqlserver.md:
- NUMA Configuration — execute the NUMA Configuration query to get MAXDOP, NUMA nodes, online schedulers, total cores, CPUs per node
- Soft NUMA status — returned by the same NUMA Configuration query (
SOFTNUMA column)
- CPU Utilization — execute Step 1 query (ring buffer history, ~4 hours)
- Per-Scheduler Load — execute Step 2 query
- External Memory Pressure — execute Step 3 query
- Memory Usage per Clerk — execute Step 4 query
- Disk Volume Free Space — execute Step 5 query (if
IncludeDiskSpace = true)
- Database Space — execute
EXEC sp_spaceused
- TempDB Contention — execute Step 6 query (if
IncludeTempDBAnalysis = true)
- Threadpool Health — execute Step 7 query (if
IncludeThreadpoolHealth = true)
Path B: Azure SQL Database / Fabric SQL Database (Engine Edition 5, 12)
Load and execute queries from references/queries-azuresql.md:
- CPU Utilization — execute Step 1 query (
sys.dm_db_resource_stats, ~1 hour)
- Workload Metrics — execute Step 2 query (CPU, Data IO, Log Write, Worker, Session %)
- Memory Pressure — execute Step 3 query
- Full Resource Usage Metrics — execute Step 4 query (optional, for detailed analysis)
- Memory Usage per Clerk — execute Step 5 query
- Plan Cache Bloat — execute Step 6 query
- Database Space — execute
EXEC sp_spaceused
- TempDB Contention — execute Step 7 query (if
IncludeTempDBAnalysis = true)
⚠️ TempDB latch waits may not be visible on Azure SQL DB / Fabric (DMV is database-scoped)
- Threadpool Health — execute Step 8 query (if
IncludeThreadpoolHealth = true)
Report Template
Generate the report using the appropriate layout below based on the detected platform. Replace {{ }} sections with analysis from the collected data. Do not show the instructions to the user.
Report Layout — SQL Server / Managed Instance
## Resource Usage Report
Server Name: {{current server name}}
Date: {{current date in YYYY-MM-DD format}}
---
### CPU Usage
#### Current CPU and NUMA Configuration:
MAXDOP: {{MAXDOP setting}}
Nodes: {{number of NUMA nodes}}
OnlineSchedulers: {{number of online schedulers}}
TotalCores: {{total number of cores}}
CPU_per_Node: {{number of CPUs per NUMA node}}
SOFTNUMA: {{SOFTNUMA status}}
#### CPU Utilization:
> Data sourced from `RING_BUFFER_SCHEDULER_MONITOR`, which retains approximately the last 4 hours (~1 sample/minute).
{{1 to 2 sentence summary of the historical CPU utilization highlighting any periods with relatively high CPU usage. Note whether SQL Server or external processes are consuming CPU.}}
#### Per-Scheduler Load Summary:
{{1 to 2 sentence summary of the load balancing across SQLOS schedulers and whether or not there are any concerns.}}
---
### Memory Usage
#### Memory Pressure Checks
##### Physical Memory:
Total Server Physical Memory: {{total server physical memory value}}
Available Server Physical Memory: {{available server physical memory value}}
Memory State: {{physical memory state value}}
##### Process Memory:
Physical Memory Used: {{physical memory used value}}
Memory Utilization Percentage: {{memory utilization percentage value}}
##### Analysis
{{one sentence summary of your analysis of the notifications and if there are any concerns}}
#### Memory Allocation per Clerk (Top {{TopNClerks}})
{{list of memory allocation per clerk}}
##### Analysis:
{{one sentence summarizing your analysis of the allocation across memory clerks and if there are any concerns}}
---
### Disk Volume Free Space
{{table of disk volumes with Drive, Drive Name, Total Size (GB), Available Size (GB), Free Space %}}
##### Analysis:
{{one sentence summarizing disk space status. Flag any volumes with less than 15% free space as a concern.}}
---
### Disk Space Usage
#### Database: {{current database name}}
Database Size: {{current database size value}}
Unallocated Space: {{unallocated space value}}
Reserved: {{reserved space value}}
Data: {{data space value}}
Index Size: {{index size value}}
Unused: {{unused space value}}
##### Analysis:
{{one sentence summarizing your analysis of the disk space usage and if there are any concerns}}
---
### TempDB Contention
#### Active TempDB Latch Waits:
{{table showing session_id, wait_type, wait_duration_ms, PageType (PFS/GAM/SGAM), ContentionSeverity}}
##### Analysis:
{{one sentence summary of TempDB contention. If HIGH TEMPDB CONTENTION detected, note the page type causing issues.}}
##### Recommendations:
- If PFS page contention: Consider enabling trace flag 1118 (pre-SQL 2016) or mixed extents are disabled by default (SQL 2016+)
- If multiple sessions waiting: Consider adding more TempDB data files (1 per CPU core, up to 8)
- If GAM/SGAM contention: Heavy object creation in TempDB; review temp table usage patterns
---
### Threadpool Health
#### Current Thread Status:
Platform: {{platform}}
Total Runnable Tasks: {{TotalRunnableTasks}}
Total Queued Tasks: {{TotalQueuedTasks}}
Threadpool Waits: {{ThreadPoolWaits}}
Thread Health: {{ThreadHealth classification}}
##### Analysis:
{{one sentence based on ThreadHealth status and LikelyCause from query}}
##### Recommendations:
- If CRITICAL (Thread Pool Starvation): Check for blocking chains, reduce parallel query concurrency, review MAXDOP settings
- If HIGH RISK (Worker Queue Buildup): Identify long-running queries, check for resource contention
- If WARNING (Thread Pressure): Monitor trend; may indicate approaching capacity limits
---
### Summary of Findings
{{1 to 2 sentence summary of the overall resource usage analysis and if there are any concerns.}}
If you would like details on any of the analysis sections, please let me know.
Report Layout — Azure SQL Database / Fabric SQL Database
## Resource Usage Report
Database Name: {{current database name}}
Date: {{current date in YYYY-MM-DD format}}
---
### CPU Usage
#### CPU Utilization:
> Data sourced from `sys.dm_db_resource_stats`, which retains the last ~1 hour (15-second intervals).
{{1 to 2 sentence summary of the historical CPU utilization highlighting any periods with relatively high CPU usage. For Azure SQL DB, note whether it is a DB-specific or instance-wide issue.}}
#### Per-Scheduler Load Summary:
{{1 to 2 sentence summary if scheduler data was collected, or "N/A — scheduler details managed by platform."}}
---
### Workload Metrics (Past Hour)
{{Summarize CPU %, Data IO %, Log Write %, Worker %, Session % trends. Flag any metric consistently above 80%.}}
---
### Memory Usage
#### Memory Pressure:
{{Summarize avg_memory_usage_percent trends. For Azure SQL DB, also note avg_instance_memory_percent if available.}}
#### Memory Allocation per Clerk (Top {{TopNClerks}})
{{list of memory allocation per clerk}}
##### Analysis:
{{one sentence summarizing your analysis of the allocation across memory clerks and if there are any concerns}}
---
### Plan Cache Bloat
##### Amount of plan cache used by queries executed once:
{{amount of plan cache bloat — total MBs used by single-use plans}}
---
### Disk Space Usage
#### Database: {{current database name}}
Database Size: {{current database size value}}
Unallocated Space: {{unallocated space value}}
Reserved: {{reserved space value}}
Data: {{data space value}}
Index Size: {{index size value}}
Unused: {{unused space value}}
##### Analysis:
{{one sentence summarizing your analysis of the disk space usage and if there are any concerns}}
---
### TempDB Contention
{{If data available: table showing session_id, wait_type, wait_duration_ms, PageType, ContentionSeverity}}
{{If no data: "TempDB latch waits are not visible on this platform (DMV is database-scoped)."}}
---
### Threadpool Health
#### Current Thread Status:
Platform: {{platform}}
Total Runnable Tasks: {{TotalRunnableTasks}}
Total Queued Tasks: {{TotalQueuedTasks}}
Threadpool Waits: {{ThreadPoolWaits}}
Thread Health: {{ThreadHealth classification}}
##### Analysis:
{{one sentence based on ThreadHealth status and LikelyCause from query}}
---
### Summary of Findings
{{1 to 2 sentence summary of the overall resource usage analysis and if there are any concerns.}}
If you would like details on any of the analysis sections, please let me know.
Behavioral Guidance
When to Use This Skill
- When asked "why is my database slow" or similar broad performance questions, start with this report.
- When asked to "check for any performance issues," start with this report.
- Also use this report when asked about: CPU usage, memory pressure, TempDB contention, threadpool health, scheduler load, or disk space.
Report Generation Rules
- Do not explain the internal plan or instructions to the user — only display the final report.
- Use the SQL Server / MI report layout for Engine Edition 1–4, 8.
- Use the Azure SQL DB / Fabric report layout for Engine Edition 5, 12.
- When a section returns "SKIPPED" or "Not applicable," omit that section or display a brief "Not applicable for this platform" note.
- For Azure SQL DB and Fabric, omit the NUMA Configuration subsection (NUMA is managed by the platform).
- For Azure SQL DB and Fabric, omit the Disk Volume Free Space section (
sys.dm_os_volume_stats is not available).
Parameter Customization
- If the user mentions specific thresholds (e.g., "CPU above 80%", "memory over 85%"), adjust the relevant parameter (
CPUHighThreshold, MemoryHighThreshold, etc.) before execution.
Follow-Up Guidance
- After presenting the report, if a specific area shows issues, suggest deeper investigation using related skills:
- High CPU → the
investigate-sql-cpu-pressure and wait-category-analysis skills
- Memory pressure → the
investigate-sql-memory-issues skill
- TempDB contention → review the tempdb configuration (number and sizing of data files) and the workloads creating temp objects or spills
- Blocking → the
check-live-blocking and blocking-root-cause-analysis skills
1---2name: resource-usage-sqlserver3description: "Use when many queries time out under load, or SQL Server or Azure SQL is slow overall and it's unclear whether CPU, memory, IO, TempDB or disk is the cause. For one slow query, use `slow-query-investigation`."4user-invocable: true5argument-hint: "[CPUHighThreshold] [MemoryHighThreshold]"6metadata:7 source: https://skillmd.com/skills/microsoft/resource-usage-sqlserver8---910# Resource Usage Report — All SQL Platforms1112Use this skill when the user asks about:13- Overall resource usage or performance troubleshooting14- CPU utilization ("why is CPU high?", "is SQL or OS using CPU?")15- Memory pressure ("is there memory pressure?", "what's using memory?")16- Disk space ("how much disk space is left?", "are drives running low?")17- TempDB contention ("is TempDB causing issues?", "PFS/GAM contention")18- Threadpool health ("are we running out of workers?", "thread starvation")19- General slowness ("why is my database slow?", "performance check")2021Targets **all SQL platforms**:22- **SQL Server** (on-premises, VM, IaaS) — Engine Edition 1–423- **Azure SQL Managed Instance** — Engine Edition 824- **Azure SQL Database** — Engine Edition 525- **Fabric SQL Database** — Engine Edition 122627> **Unsupported Platforms**: Azure Synapse Analytics (Engine Edition 6, 11) and Azure SQL Edge (Engine Edition 9) are not supported. Queries will return an early-exit message on these platforms.2829## Scope3031- Produces an initial resource snapshot, including worker or session limits and thread starvation, to choose the next focused investigation.32- For one identified slow query, use the `slow-query-investigation` skill; for a configuration, security, or backup audit, use the `health-audit-sqlserver` skill.3334## Azure SQL Database specialization3536For Azure SQL Database (EngineEdition 5), read [Azure-specific guidance](references/azure-sql/guidance.md) before choosing diagnostic queries. It preserves the service-specific permissions, capture limitations and error interpretation. Keep this skill's scope and authorization rules; the reference is not a second workflow to run unconditionally.3738### Azure scope and interpretation3940Detect the actual platform before selecting DMVs. Azure database resource percentages and instance percentages have different denominators; do not treat them as interchangeable. High memory utilization alone is not proof of memory pressure. Correlate the same time window with waits, worker/session limits and resource-governance evidence; distinguish a governed IO ceiling from storage latency. An empty or permission-denied result is not zero utilization. Local container behavior is not proof of managed-service limits.4142After identifying the bottleneck, use `investigate-sql-cpu-pressure`, `investigate-sql-data-io-pressure`, `investigate-sql-log-io-pressure` or `investigate-sql-memory-issues` for focused diagnosis. A read-only diagnosis does not authorize scaling or configuration changes.434445## Required tools4647- A read-only SQL query tool connected to the target server and database. Prefer, in order: the SQL48 Tools MCP server that ships with the `microsoft-sql-admin` plugin49 (`mssql_list_database_connections`, `mssql_connect_database`, then `mssql_execute_query`); any50 other SQL tool the agent host provides for running T-SQL and reading result sets;51 [`sqlcmd`](https://learn.microsoft.com/sql/tools/sqlcmd/sqlcmd-utility) from a terminal. If the52 SQL Tools MCP server is not connected or lists no connections, follow the `sql-tools-mcp-setup`53 skill, which asks before installing or configuring anything. If no SQL tool can be made available,54 give the user the T-SQL to run and ask for the results.55- Least privilege: connect that tool with a diagnostic login that cannot write, for example one that56 holds only `VIEW SERVER PERFORMANCE STATE` (`VIEW SERVER STATE` before SQL Server 2022) or, on Azure57 SQL Database, `VIEW DATABASE PERFORMANCE STATE` or `##MS_ServerStateReader##`, plus any other read58 permission these queries need. A tool is only as read-only as the login it connects with.5960## Parameters6162| Parameter | Default | Description |63|-----------|---------|-------------|64| TopNClerks | `10` | Number of memory clerks to display in memory allocation breakdown |65| CPUHighThreshold | `70` | CPU percentage above which to classify as "HIGH" |66| MemoryHighThreshold | `90` | Memory percentage above which to classify as "HIGH" |67| DiskFreeWarningPct | `15` | Free space percentage below which to flag as warning |68| TempDBWaitThresholdMs | `50` | Minimum wait duration (ms) to include in TempDB contention analysis |69| TempDBHighSeverityMs | `1000` | Wait duration (ms) above which TempDB contention is classified as HIGH |70| RunnableTasksWarning | `5` | Runnable tasks count threshold for "THREAD PRESSURE" warning |71| MemoryLowThresholdPct | `10` | Available memory percentage below which to flag OS memory pressure (SQL Server/MI only) |72| MaxSchedulers | `32` | Maximum scheduler rows to return in per-scheduler load analysis |73| IncludeTempDBAnalysis | `true` | Whether to run TempDB contention check |74| IncludeThreadpoolHealth | `true` | Whether to run threadpool health analysis |75| IncludeDiskSpace | `true` | Whether to run disk volume free space check (SQL Server/MI only) |76| MaxResults | `20` | Maximum rows to return per diagnostic section |7778## Data Collection Steps7980Gather all of the following data before generating the report:8182### Step 0: Detect Platform831. **Detect platform** — load and execute the **Step 0** query from either `references/queries-sqlserver.md` or `references/queries-azuresql.md`842. Based on the `engine_edition` result, follow the appropriate path below:8586| Engine Edition | Platform | Query File |87|----------------|----------|------------|88| 1–4 | SQL Server (on-prem / IaaS) | `references/queries-sqlserver.md` |89| 8 | Azure SQL Managed Instance | `references/queries-sqlserver.md` |90| 5 | Azure SQL Database | `references/queries-azuresql.md` |91| 12 | Fabric SQL Database | `references/queries-azuresql.md` |92| 6, 9, 11 | Unsupported | **Stop** — report unsupported platform |9394### Path A: SQL Server / Managed Instance (Engine Edition 1–4, 8)9596Load and execute queries from **`references/queries-sqlserver.md`**:97981. **NUMA Configuration** — execute the NUMA Configuration query to get MAXDOP, NUMA nodes, online schedulers, total cores, CPUs per node992. **Soft NUMA status** — returned by the same NUMA Configuration query (`SOFTNUMA` column)1003. **CPU Utilization** — execute Step 1 query (ring buffer history, ~4 hours)1014. **Per-Scheduler Load** — execute Step 2 query1025. **External Memory Pressure** — execute Step 3 query1036. **Memory Usage per Clerk** — execute Step 4 query1047. **Disk Volume Free Space** — execute Step 5 query *(if `IncludeDiskSpace = true`)*1058. **Database Space** — execute `EXEC sp_spaceused`1069. **TempDB Contention** — execute Step 6 query *(if `IncludeTempDBAnalysis = true`)*10710. **Threadpool Health** — execute Step 7 query *(if `IncludeThreadpoolHealth = true`)*108109### Path B: Azure SQL Database / Fabric SQL Database (Engine Edition 5, 12)110111Load and execute queries from **`references/queries-azuresql.md`**:1121131. **CPU Utilization** — execute Step 1 query (`sys.dm_db_resource_stats`, ~1 hour)1142. **Workload Metrics** — execute Step 2 query (CPU, Data IO, Log Write, Worker, Session %)1153. **Memory Pressure** — execute Step 3 query1164. **Full Resource Usage Metrics** — execute Step 4 query *(optional, for detailed analysis)*1175. **Memory Usage per Clerk** — execute Step 5 query1186. **Plan Cache Bloat** — execute Step 6 query1197. **Database Space** — execute `EXEC sp_spaceused`1208. **TempDB Contention** — execute Step 7 query *(if `IncludeTempDBAnalysis = true`)*121 > ⚠️ TempDB latch waits may not be visible on Azure SQL DB / Fabric (DMV is database-scoped)1229. **Threadpool Health** — execute Step 8 query *(if `IncludeThreadpoolHealth = true`)*123124## Report Template125126Generate the report using the appropriate layout below based on the detected platform. Replace `{{ }}` sections with analysis from the collected data. Do not show the instructions to the user.127128### Report Layout — SQL Server / Managed Instance129```130## Resource Usage Report131Server Name: {{current server name}}132Date: {{current date in YYYY-MM-DD format}}133---134### CPU Usage135#### Current CPU and NUMA Configuration:136 MAXDOP: {{MAXDOP setting}}137 Nodes: {{number of NUMA nodes}}138 OnlineSchedulers: {{number of online schedulers}}139 TotalCores: {{total number of cores}}140 CPU_per_Node: {{number of CPUs per NUMA node}}141 SOFTNUMA: {{SOFTNUMA status}}142#### CPU Utilization:143> Data sourced from `RING_BUFFER_SCHEDULER_MONITOR`, which retains approximately the last 4 hours (~1 sample/minute).144145{{1 to 2 sentence summary of the historical CPU utilization highlighting any periods with relatively high CPU usage. Note whether SQL Server or external processes are consuming CPU.}}146#### Per-Scheduler Load Summary:147{{1 to 2 sentence summary of the load balancing across SQLOS schedulers and whether or not there are any concerns.}}148---149### Memory Usage150#### Memory Pressure Checks151##### Physical Memory:152 Total Server Physical Memory: {{total server physical memory value}}153 Available Server Physical Memory: {{available server physical memory value}}154 Memory State: {{physical memory state value}}155##### Process Memory:156 Physical Memory Used: {{physical memory used value}}157 Memory Utilization Percentage: {{memory utilization percentage value}}158##### Analysis159{{one sentence summary of your analysis of the notifications and if there are any concerns}}160#### Memory Allocation per Clerk (Top {{TopNClerks}})161{{list of memory allocation per clerk}}162##### Analysis:163{{one sentence summarizing your analysis of the allocation across memory clerks and if there are any concerns}}164---165### Disk Volume Free Space166{{table of disk volumes with Drive, Drive Name, Total Size (GB), Available Size (GB), Free Space %}}167##### Analysis:168{{one sentence summarizing disk space status. Flag any volumes with less than 15% free space as a concern.}}169---170### Disk Space Usage171#### Database: {{current database name}}172 Database Size: {{current database size value}}173 Unallocated Space: {{unallocated space value}}174 Reserved: {{reserved space value}}175 Data: {{data space value}}176 Index Size: {{index size value}}177 Unused: {{unused space value}}178##### Analysis:179{{one sentence summarizing your analysis of the disk space usage and if there are any concerns}}180---181### TempDB Contention182#### Active TempDB Latch Waits:183{{table showing session_id, wait_type, wait_duration_ms, PageType (PFS/GAM/SGAM), ContentionSeverity}}184##### Analysis:185{{one sentence summary of TempDB contention. If HIGH TEMPDB CONTENTION detected, note the page type causing issues.}}186##### Recommendations:187- If PFS page contention: Consider enabling trace flag 1118 (pre-SQL 2016) or mixed extents are disabled by default (SQL 2016+)188- If multiple sessions waiting: Consider adding more TempDB data files (1 per CPU core, up to 8)189- If GAM/SGAM contention: Heavy object creation in TempDB; review temp table usage patterns190---191### Threadpool Health192#### Current Thread Status:193 Platform: {{platform}}194 Total Runnable Tasks: {{TotalRunnableTasks}}195 Total Queued Tasks: {{TotalQueuedTasks}}196 Threadpool Waits: {{ThreadPoolWaits}}197 Thread Health: {{ThreadHealth classification}}198##### Analysis:199{{one sentence based on ThreadHealth status and LikelyCause from query}}200##### Recommendations:201- If CRITICAL (Thread Pool Starvation): Check for blocking chains, reduce parallel query concurrency, review MAXDOP settings202- If HIGH RISK (Worker Queue Buildup): Identify long-running queries, check for resource contention203- If WARNING (Thread Pressure): Monitor trend; may indicate approaching capacity limits204---205### Summary of Findings206{{1 to 2 sentence summary of the overall resource usage analysis and if there are any concerns.}}207If you would like details on any of the analysis sections, please let me know.208```209210### Report Layout — Azure SQL Database / Fabric SQL Database211```212## Resource Usage Report213Database Name: {{current database name}}214Date: {{current date in YYYY-MM-DD format}}215---216### CPU Usage217#### CPU Utilization:218> Data sourced from `sys.dm_db_resource_stats`, which retains the last ~1 hour (15-second intervals).219220{{1 to 2 sentence summary of the historical CPU utilization highlighting any periods with relatively high CPU usage. For Azure SQL DB, note whether it is a DB-specific or instance-wide issue.}}221#### Per-Scheduler Load Summary:222{{1 to 2 sentence summary if scheduler data was collected, or "N/A — scheduler details managed by platform."}}223---224### Workload Metrics (Past Hour)225{{Summarize CPU %, Data IO %, Log Write %, Worker %, Session % trends. Flag any metric consistently above 80%.}}226---227### Memory Usage228#### Memory Pressure:229{{Summarize avg_memory_usage_percent trends. For Azure SQL DB, also note avg_instance_memory_percent if available.}}230#### Memory Allocation per Clerk (Top {{TopNClerks}})231{{list of memory allocation per clerk}}232##### Analysis:233{{one sentence summarizing your analysis of the allocation across memory clerks and if there are any concerns}}234---235### Plan Cache Bloat236##### Amount of plan cache used by queries executed once:237 {{amount of plan cache bloat — total MBs used by single-use plans}}238---239### Disk Space Usage240#### Database: {{current database name}}241 Database Size: {{current database size value}}242 Unallocated Space: {{unallocated space value}}243 Reserved: {{reserved space value}}244 Data: {{data space value}}245 Index Size: {{index size value}}246 Unused: {{unused space value}}247##### Analysis:248{{one sentence summarizing your analysis of the disk space usage and if there are any concerns}}249---250### TempDB Contention251{{If data available: table showing session_id, wait_type, wait_duration_ms, PageType, ContentionSeverity}}252{{If no data: "TempDB latch waits are not visible on this platform (DMV is database-scoped)."}}253---254### Threadpool Health255#### Current Thread Status:256 Platform: {{platform}}257 Total Runnable Tasks: {{TotalRunnableTasks}}258 Total Queued Tasks: {{TotalQueuedTasks}}259 Threadpool Waits: {{ThreadPoolWaits}}260 Thread Health: {{ThreadHealth classification}}261##### Analysis:262{{one sentence based on ThreadHealth status and LikelyCause from query}}263---264### Summary of Findings265{{1 to 2 sentence summary of the overall resource usage analysis and if there are any concerns.}}266If you would like details on any of the analysis sections, please let me know.267```268269## Behavioral Guidance270271### When to Use This Skill272- When asked "why is my database slow" or similar broad performance questions, start with this report.273- When asked to "check for any performance issues," start with this report.274- Also use this report when asked about: CPU usage, memory pressure, TempDB contention, threadpool health, scheduler load, or disk space.275276### Report Generation Rules277- Do not explain the internal plan or instructions to the user — only display the final report.278- Use the **SQL Server / MI** report layout for Engine Edition 1–4, 8.279- Use the **Azure SQL DB / Fabric** report layout for Engine Edition 5, 12.280- When a section returns "SKIPPED" or "Not applicable," omit that section or display a brief "Not applicable for this platform" note.281- For Azure SQL DB and Fabric, omit the NUMA Configuration subsection (NUMA is managed by the platform).282- For Azure SQL DB and Fabric, omit the Disk Volume Free Space section (`sys.dm_os_volume_stats` is not available).283284### Parameter Customization285- If the user mentions specific thresholds (e.g., "CPU above 80%", "memory over 85%"), adjust the relevant parameter (`CPUHighThreshold`, `MemoryHighThreshold`, etc.) before execution.286287### Follow-Up Guidance288- After presenting the report, if a specific area shows issues, suggest deeper investigation using related skills:289 - High CPU → the `investigate-sql-cpu-pressure` and `wait-category-analysis` skills290 - Memory pressure → the `investigate-sql-memory-issues` skill291 - TempDB contention → review the tempdb configuration (number and sizing of data files) and the workloads creating temp objects or spills292 - Blocking → the `check-live-blocking` and `blocking-root-cause-analysis` skills