Skip to content

Add Query Store collector spike diagnostic timing#518

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/query-store-spike-diagnostic
Mar 11, 2026
Merged

Add Query Store collector spike diagnostic timing#518
erikdarlingdata merged 1 commit intodevfrom
fix/query-store-spike-diagnostic

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Splits the Query Store collector's DuckDB write stopwatch into three components: reader (SqlDataReader), append (DuckDB appender), and flush (appender dispose)
  • Logs a warning when total exceeds 2 seconds, showing the breakdown
  • Zero overhead under normal operation (Stopwatch is nanosecond-cost, warning only fires on spikes)

Context

During HammerDB TPC-H load testing, the Query Store collector showed 7-22 second spikes. This diagnostic identified the root cause: SQL Server's Query Store DMVs are slow to return rows under heavy analytical workload (reader: 11,764ms, append: 20ms, flush: 10ms). DuckDB is not the bottleneck.

Test plan

  • Monitored for 4+ hours with zero issues
  • Confirmed warning fires correctly during TPC-H load spikes
  • Verified zero log spam during normal idle operation (15-row collections at 300-550ms)

🤖 Generated with Claude Code

Splits the DuckDB write stopwatch into three components (SqlDataReader,
appender, flush) and logs a warning when total exceeds 2 seconds. This
identified SQL Server Query Store DMV contention as the root cause of
collector spikes during heavy analytical workloads — not DuckDB writes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit c3668ee into dev Mar 11, 2026
erikdarlingdata added a commit that referenced this pull request Mar 11, 2026
Add missing changelog entries for PRs #503-#518: DuckDB 1.5.0 upgrade,
parquet compaction (13-26x perf improvement), SignPath code signing,
ReadOnlyIntent, status bar used/file size, collector diagnostics,
plan viewer fixes. Update README with code signing note, DuckDB 1.5.0
data storage section, ReadOnlyIntent quick start, expanded FinOps
description. Release date set to 2026-03-11.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata deleted the fix/query-store-spike-diagnostic branch April 9, 2026 00:34
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