Repository navigation
Narrow the Query Store slicer's clock-skew margin to an hour; the interval-table move is blocked (#3953) - #4311
Merged
Conversation
…ur (#3953) Ruling item 2 on #3953: the slicer's collection_time floor already carries interval_start_time_utc <= collection_time as its real bound, so the extra day below the window start was pure clock-skew slack, over-broad by 23 hours. Narrowed to an hour, which still covers realistic skew between the monitored server's clock and the store's. The ceiling (30 days, covering Query Store's max interval length plus collector-outage catch-up) is a different bound and is untouched. QueryStoreSlicerSql_KeepsSlackenedCollectionTimeBoundsForChunkExclusion updated to pin the new hour literal instead of the old day literal. Ruling item 1 (moving this read, get_query_store_top and the WPF viewer's QueryStoreTopSql onto query_store_interval_latest) is parked: the table #4208 shipped is Regular-execution-type only (both by its write filter and by an identity that omits execution_type_desc) and is missing most of the columns these two reads select. Full analysis posted on #3953 (issuecomment-5835309188). Follow-up for the rest of the still-deduplicating Query Store reads filed as #4310. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TszxYhJJbTEh4LrZ56NYo3
erikdarlingdata
marked this pull request as ready for review
September 25, 2026 16:29
erikdarlingdata
deleted the
fix/3953-query-store-reads-interval-table
branch
September 25, 2026 16:29
This was referenced Sep 25, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #3953.
Why
#3953 asks the Query Store reads to stop deduplicating the raw slice on every pass. This PR ships one small part of that. The main change needs a design decision first (see "Not in this PR"), so #3953 stays open.
What changes
ViewerDataService.QueryStoreSlicerSql: the lower chunk-exclusion boundcollection_time >= $2 - interval '1 day'becomescollection_time >= $2 - interval '1 hour'.COALESCE(interval_start_time_utc, collection_time) >= $2. An interval is always collected after it starts, so a row in the window also hascollection_time >= $2. The margin below$2is there only for clock skew between the monitored server and the store, and an hour covers that. A 24-hour window that ends now reads 25 hours ofcollection_timeinstead of 48.collection_time <= $3 + interval '30 days', does not change. It covers Query Store's longest interval (1 day) plus up to 29 days of collector outage.ViewerQueriesTests.QueryStoreSlicerSql_KeepsSlackenedCollectionTimeBoundsForChunkExclusionpins the new bound, and the comment in the SQL explains it.Not in this PR
The main change in #3953 moves three Query Store reads onto
query_store_interval_latest, the table #4208 added for PLAN_REGRESSION. The table as built cannot serve them:execution_type_desc = 'Regular', and its key does not includeexecution_type_desc. All three reads also need the Aborted and Exception rows.The analysis and the options for a fix are on #3953 (issuecomment-5835309188). #4310 tracks the other Query Store reads that still deduplicate the raw slice.
Test plan
ViewerQueriesTests.QueryStoreSlicerSql_KeepsSlackenedCollectionTimeBoundsForChunkExclusionchecks the new bound.EXPLAINrun and no local full suite ran for this PR. CI runs the full suite.ec9690f4: build, Darling PostgreSQL tests and Lite tests all pass.CHANGELOG entry
SECTION: Fixed
ENTRY:
REF:
[Narrow the Query Store slicer's clock-skew margin to an hour; the interval-table move is blocked (#3953) #4311]: Narrow the Query Store slicer's clock-skew margin to an hour; the interval-table move is blocked (#3953) #4311
🤖 Generated with Claude Code
https://claude.ai/code/session_01FVjn4PBJN71NQXdFo6ZxNQ