Skip to content

Comments

Full Dashboard column parity + last_execution_time filter#250

Merged
erikdarlingdata merged 1 commit intodevfrom
feature/delta-calculator-fix
Feb 24, 2026
Merged

Full Dashboard column parity + last_execution_time filter#250
erikdarlingdata merged 1 commit intodevfrom
feature/delta-calculator-fix

Conversation

@erikdarlingdata
Copy link
Owner

Summary

  • Adds all missing DMV columns to query_stats (52 cols), procedure_stats (37 cols), and query_store_stats (57 cols) collectors
  • Fixes stale queries appearing in UI by filtering on last_execution_time using server UTC offset
  • Delta calculator now keys on plan_handle (falls back to query_hash) and removes seeding for query/procedure stats
  • Schema v13 migration drops and recreates affected tables
  • Drill-down views updated with new columns (spills, min/max CPU/duration, DOP)

Test plan

  • v13 migration runs clean on fresh and existing databases
  • All collectors successful across 4 servers (SQL2016-SQL2022)
  • Hot table data verified: all new columns populated, zero unexpected NULLs
  • Archive views work via UNION ALL BY NAME with old parquet files
  • Ran exact UI display queries against live DuckDB — correct results
  • last_execution_time filter correctly converts UTC window to server-local time

🤖 Generated with Claude Code

…store_stats

Adds all missing columns from SQL Server DMVs to the three query/procedure
collectors, fixing the root cause of stale queries appearing in the UI.

Schema (v13):
- query_stats: 52 columns (was ~30) — adds last_execution_time, creation_time,
  total_spills, min/max spills, min/max grant_kb, min/max used_grant_kb,
  min/max ideal_grant_kb, min/max reserved/used threads, min/max physical_reads,
  min/max rows, min/max DOP, total_clr_time, columnstore segment reads/skips
- procedure_stats: 37 columns — adds last_execution_time, min/max worker_time,
  min/max elapsed_time, min/max logical_reads/writes, min/max physical_reads,
  total/min/max spills, last_physical_reads
- query_store_stats: 57 columns — adds module_name, min/max DOP, is_forced_plan,
  plan_forcing_type, force_failure_count, last_force_failure_reason,
  compatibility_level, query_plan_hash, version-gated columns for SQL 2017+
  (avg_num_physical_io_reads, avg_log_bytes_used, avg_tempdb_space_used) and
  SQL 2022+ (plan_type_desc)

Delta calculator:
- Uses plan_handle as delta key (falls back to query_hash) to prevent
  cross-contamination between plans for the same query
- Removes seeding for query_stats and procedure_stats — single-execution
  queries are no longer invisible

Display queries:
- Adds last_execution_time filter using server UTC offset to exclude stale
  queries from the plan cache that haven't executed within the time window
- Query Store already stores last_execution_time as UTC, so no offset needed
- Drill-down views updated: ProcedureHistory gets spills/min/max CPU/duration,
  QueryStoreHistory gets Min/Max DOP columns

Tested: v13 migration clean, all collectors successful across 4 servers,
verified hot table and parquet archive data integrity, ran exact UI display
queries against live data with correct results.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 067f777 into dev Feb 24, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant