Repository navigation
At "Last 7 days" the WPF Queries grids silently show ~4 days: Top Queries, Top Procedures and Query Store read raw tables dropped at 4 days, with no floor disclosure (get_query_store_top got one in #2364; the viewer and the query-stats MCP tools didn't) #4231
Copy link
Copy link
Closed
Labels
bugSomething isn't workingSomething isn't workingclient-siteOwned by the client-site agents (other laptop). Local sessions never pick these up.Owned by the client-site agents (other laptop). Local sessions never pick these up.in-progressActively being worked by a local session or its agents (PR open or in flight)Actively being worked by a local session or its agents (PR open or in flight)
Description
Activity
- addedbugSomething isn't workingSomething isn't workingclient-siteOwned by the client-site agents (other laptop). Local sessions never pick these up.Owned by the client-site agents (other laptop). Local sessions never pick these up.
on Sep 25, 2026 Ruled: how this gets built
Three pieces, in this order:
- Darling disclosure (now). One shared floor helper for
query_stats,procedure_statsandquery_store_stats, built from get_query_store_top reports a window it cannot serve: raw query_store_stats is dropped at 4 days #2364'sQueryStoreWindowFloorSql. It must stay a one-chunk probe. The PR says "Part of At "Last 7 days" the WPF Queries grids silently show ~4 days: Top Queries, Top Procedures and Query Store read raw tables dropped at 4 days, with no floor disclosure (get_query_store_top got one in #2364; the viewer and the query-stats MCP tools didn't) #4231".get_top_queries_by_cpuandget_top_procedures_by_cpuaddeffective_start,effective_hours_backandwindow_truncated, with the same names and meaning asget_query_store_top. Existing fields and defaults stay as they are.- The WPF Top Queries, Top Procedures and Query Store grids show "Showing since " in the header when the window is cut short. The web viewer's pages for the same tools show the same note.
- The threshold is get_query_store_top reports a window it cannot serve: raw query_store_stats is dropped at 4 days #2364's 90-minute slack, reusing its constant.
- Lite disclosure (next). Lite keeps 30 days of raw query data by default. A user can lower that, and a new install has less history, so the same silent cut can happen there. Same rules, Lite's own grids and tools.
- Routing the top-N reads to the hourly rollups (after Legacy trio off the refresh grid (#3653) #4186 merges). This builds on
RollupCoverage, and Legacy trio off the refresh grid (#3653) #4186 changes it. The disclosure ships first either way, and it is still needed forquery_store_stats, which has no rollup that keepsquery_id.
\U0001F916 Generated with Claude Code
- Darling disclosure (now). One shared floor helper for
- addedin-progressActively being worked by a local session or its agents (PR open or in flight)Actively being worked by a local session or its agents (PR open or in flight)
on Sep 25, 2026 - added 9 commits that reference this issue
on Sep 25, 2026 - added 4 commits that reference this issue
on Sep 25, 2026 - added 5 commits that reference this issue
on Sep 26, 2026 Claude posting for Erik Darling.
#4413 is merged, stage 3b.
get_top_procedures_by_cpuand the Viewer's Top Procedures grid now read the hourly rollup once raw retention has dropped the window, and reporttier_usedandprecision_note.Claude posting for Erik Darling.
Closing: all three pieces of the build plan are on dev.
- Darling disclosure: MCP top-queries/top-procedures disclose a shortened raw-tier window (#4231) #4278.
get_top_queries_by_cpuandget_top_procedures_by_cpureporteffective_start/effective_hours_back/window_truncated, and the WPF Top Queries, Top Procedures and Query Store grids show "Showing since …" when the window is cut short. - Lite disclosure: Lite MCP tools disclose a truncated query-stats window (#4231) #4279.
- Routing to the hourly rollups: Top-N-by-CPU routes to the hourly rollup once raw's floor ages past the window (#4231) #4396 (top queries) and Route get_top_procedures_by_cpu and the Top Procedures grid to the hourly rollup (#4231) #4413 (top procedures). Once raw retention has dropped part of the window, both read the hourly rollup, and they report
tier_usedandprecision_note.
query_store_statskeeps the disclosure only, because no rollup carriesquery_id. That was in the plan from the start.- Darling disclosure: MCP top-queries/top-procedures disclose a shortened raw-tier window (#4231) #4278.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingclient-siteOwned by the client-site agents (other laptop). Local sessions never pick these up.Owned by the client-site agents (other laptop). Local sessions never pick these up.in-progressActively being worked by a local session or its agents (PR open or in flight)Actively being worked by a local session or its agents (PR open or in flight)
Problem
The WPF server tab's toolbar offers "Last 7 days". Three Queries sub-tabs read only raw tables, and all three are dropped at 4 days on a store with the rollups armed:
query_statsprocedure_statsquery_store_statsNone of these reads routes to a rollup, and none reports how far back it actually reached. At 7 days the grid ranks about 4.2 days of work under a header and toolbar that say 7, and nothing on screen says so.
#2364 fixed exactly this for MCP
get_query_store_top: it reads the window floor and returnseffective_start/window_truncated. The WPF Query Store grid, the WPF Top Queries and Top Procedures grids, and MCPget_top_queries_by_cpu/get_top_procedures_by_cpunever got the same treatment. The WPF viewer's own Performance Trends tab does disclose (QueryTrendSeries.Truncated, rendered in the plot title), so one tab of one screen is honest and the grid beside it isn't.It's also the expensive way to be wrong: the 7-day read scans and dedupes all 4 days of raw.
Measured
2026-09-25, read-only:
query_statsandprocedure_statsboth start at 2026-09-21 00:00, 4.19 days back at 04:32Z. Store A (live Query Store), one busy server:query_store_statsstarts at 2026-09-21 00:02, 918,803 rows in the "7-day" window.QueryStoreTopSql) at 7 days, same server: 4,078 ms, 162.9 k buffers (28 k read). The window sort spilled:external mergeof 100 + 121 + 203 MB, 53 k temp blocks written, at that store's currentwork_mem. At 24 h the same read is 1,090 ms with no spill.Where (origin/dev)
Darling/PerformanceMonitor.Darling.Viewer/ViewerServerTab.Queries.cs:LoadTopQueriesAsync~:172,LoadTopProceduresAsync~:181,LoadQueryStoreAsync~:190. None reads a floor or renders one.Darling/PerformanceMonitor.Darling.Viewer/ViewerDataService.QueryStats.csTopQueriesSql~:149,ViewerDataService.ProcedureStats.csTopProceduresSql~:88,ViewerDataService.QueryStore.csQueryStoreTopSql~:123 andQueryStoreSlicerSql~:595.Darling/PerformanceMonitor.Darling.Service/Mcp/DarlingMcpDataTools.csget_query_store_top~:796–880, andDarlingDataReader.QueryStoreWindowFloorSql~:1323 (a boundedMIN(collection_time), a one-chunk probe).DarlingMcpDataTools.csget_top_queries_by_cpu~:515/:560 andget_top_procedures_by_cpu~:671/:690, both over rawDarlingDataReader.TopQueriesSql/ procedure reads.Fix shape
effective_start/effective_hours_back/window_truncatedlikeget_query_store_top.query_statsandprocedure_statshave query-grain hourly rollups (query_stats_hourly,procedure_stats_hourly) that the Performance Trends and FinOps reads already stitch throughRollupCoverage. A top-N by total over a window past raw retention can be served from them, the same way the trend tier ladder does it.query_store_statshas no rollup that carriesquery_id/plan_id(get_query_store_top reports a window it cannot serve: raw query_store_stats is dropped at 4 days #2364's note), so its only honest option is the disclosure.window_truncated/effective_start, name the floor;