|
25 | 25 | - [sp_HumanEvents](#human-events): Use Extended Events to track down various query performance issues |
26 | 26 | - [sp_HumanEventsBlockViewer](#human-events-block-viewer): Analyze the blocked process report |
27 | 27 | - [sp_QuickieStore](#quickie-store): The fastest and most configurable way to navigate Query Store data |
| 28 | + - [sp_QuickieCache](#quickie-cache): High-impact query detection from the plan cache using Pareto analysis |
28 | 29 | - [sp_QueryReproBuilder](#query-repro-builder): Generate executable reproduction scripts from Query Store data |
29 | 30 | - [sp_HealthParser](#health-parser): Pull all the performance-related data from the system health Extended Event |
30 | 31 | - [sp_LogHunter](#log-hunter): Get all of the worst stuff out of your error log |
@@ -329,6 +330,53 @@ Current valid parameter details: |
329 | 330 | | @version_date | datetime | OUTPUT; for support | none; OUTPUT | none; OUTPUT | |
330 | 331 |
|
331 | 332 |
|
| 333 | +[*Back to top*](#navigatory) |
| 334 | + |
| 335 | +## Quickie Cache |
| 336 | + |
| 337 | +The plan cache companion to sp_QuickieStore. While QuickieStore digs into Query Store data, QuickieCache uses the same Pareto (80/20) analysis approach against the plan cache DMVs. |
| 338 | + |
| 339 | +It aggregates data from `sys.dm_exec_query_stats`, `sys.dm_exec_procedure_stats`, `sys.dm_exec_function_stats`, and `sys.dm_exec_trigger_stats`, then scores queries across 7 resource dimensions (CPU, duration, reads, writes, memory grants, spills, executions) using `PERCENT_RANK`. Only the vital few queries with disproportionate resource consumption are surfaced. |
| 340 | + |
| 341 | +Results come in three result sets: |
| 342 | + * **Plan cache health findings**: plan age distribution, single-use plan bloat, duplicate plan detection, USERSTORE_TOKENPERM pressure |
| 343 | + * **High-impact queries**: Pareto-scored queries with impact scores, resource shares, and diagnostic signals (parameter sniffing, plan instability, wasteful grants, wait-bound queries, etc.) |
| 344 | + * **Workload profile summary**: overall concentration analysis with tuning recommendations |
| 345 | + |
| 346 | +Requires SQL Server 2016 SP1+ for full memory grant and spill analysis. |
| 347 | + |
| 348 | +Current valid parameter details: |
| 349 | + |
| 350 | +| parameter_name | data_type | description | valid_inputs | defaults | |
| 351 | +|-----------------------------|--------------|------------------------------------------------------------------------------------------------------|------------------------------------------|------------| |
| 352 | +| @top | integer | candidates per metric dimension before dedup | a positive integer | 10 | |
| 353 | +| @database_name | sysname | filter to a specific database | a valid database name | NULL | |
| 354 | +| @start_date | datetime | only include plans created after this date | a valid datetime | NULL | |
| 355 | +| @end_date | datetime | only include plans created before this date | a valid datetime | NULL | |
| 356 | +| @minimum_execution_count | bigint | minimum execution count to include a query | a positive integer | 2 | |
| 357 | +| @ignore_system_databases | bit | exclude system databases (master, model, msdb, tempdb) | 0 or 1 | 1 | |
| 358 | +| @impact_threshold | decimal(3,2) | minimum impact_score (0.00-1.00) to surface in results | 0.00 to 1.00 | 0.50 | |
| 359 | +| @debug | bit | print diagnostic information | 0 or 1 | 0 | |
| 360 | +| @help | bit | display parameter help | 0 or 1 | 0 | |
| 361 | + |
| 362 | +```sql |
| 363 | +-- Basic execution |
| 364 | +EXECUTE dbo.sp_QuickieCache; |
| 365 | + |
| 366 | +-- Focus on a specific database |
| 367 | +EXECUTE dbo.sp_QuickieCache |
| 368 | + @database_name = N'YourDatabase'; |
| 369 | + |
| 370 | +-- Only plans created today |
| 371 | +EXECUTE dbo.sp_QuickieCache |
| 372 | + @start_date = '20260403'; |
| 373 | + |
| 374 | +-- Lower the threshold to surface more queries |
| 375 | +EXECUTE dbo.sp_QuickieCache |
| 376 | + @impact_threshold = 0.25, |
| 377 | + @top = 20; |
| 378 | +``` |
| 379 | + |
332 | 380 | [*Back to top*](#navigatory) |
333 | 381 |
|
334 | 382 | ## Query Repro Builder |
|
0 commit comments