You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Query Store reads on the interval tables can miss an interval that started just below the table's floor #5541
Found in the review of PR #5531 (#5513). The gap is older than that PR. Line numbers are at dev 2186662.
What runs
Two rules decide whether a Query Store read uses a stored interval table or raw collect.query_store_stats:
QueryStoreIntervalLatest.UseTable in Darling/PerformanceMonitor.Darling.Storage/QueryStoreIntervalLatest.cs:382, for the plan regression and drill-down reads.
QueryStoreIntervalWide.UseTable in Darling/PerformanceMonitor.Darling.Storage/QueryStoreIntervalWide.cs:640, for the grid and MCP top reads.
Each one accepts the table when R >= H: raw's floor R is at or above the table's floor H. The rule reads this as "raw holds no history the table has dropped".
The gap
The two relations purge on different columns. Raw drops a snapshot by collection_time. The interval table drops an interval by its first execution time. So raw can still hold a snapshot whose interval the table dropped. The interval started before H, and the snapshot was collected at or after R.
Example: H = R = D. A one-day interval starts at D - 1 hour, and raw holds its snapshot from D + 5 hours. R >= H holds, so the read uses the table. The table dropped that interval, so the read leaves it out. The raw read counts it.
This needs H close to R: within about one interval length plus the collector's lag. On the big store, raw keeps about 4 days and the table about 15. So R sits far above H, and the gap is not reached. A store whose raw retention is close to the table's can reach it.
Fix direction
Accept the table under this clause only when R >= H + one interval + the collector's lag, so that no snapshot raw still holds can belong to an interval the table dropped. Check which column each table purges on before choosing the margin. Every input still errs toward raw. Add pure tests for R = H, R just under the margin, and R just over it, for both rules. Code only.
Activity
Interval-table gate: Wide clause 3b uses the full purge-edge margin, …
Query Store reads on the stored interval tables no longer miss an int…
erikdarlingdata commentedon Oct 8, 2026
Fixed by #5543, merged to dev. It ships in the next release. Claude posting for Erik Darling.
Query Store regressions read the per-interval table instead of re-sor…