Repository navigation
Expose Query Store execution outcomes in MCP results - #4060
erikdarlingdata merged 5 commits into
Conversation
Review fixes on top of the execution-outcome filter: - A filter that matches nothing while the unfiltered read has rows now answers `empty` on both SKUs, instead of falling through to "Query Store may not be enabled". Most queries never abort, so this was the common answer to an Aborted or Exception filter. - The filter validates through McpHelpers.ValidateChoice against a shared QueryStoreExecutionTypes set, replacing the two copies of an "INVALID" sentinel normalizer. - The filter moves into the dedup CTE, ahead of the ROW_NUMBER. The outcome is in the partition, so the result is identical and the window sort only sees the outcome asked for. - Lite keeps MAX(module_name). Grouping on it could split one plan into two rows when the object name resolved differently between collections. - The Darling viewer's grid groups by execution_type_desc too, so it matches Lite's grid (which this PR already split) and the twinned MCP read. - Tests: a Lite case with one plan and two outcomes in one interval, and live Darling assertions for the split, the filter, the empty answer, the refusal and the viewer grid.
c4501bd to
1cbcafd
Compare
|
I pushed a review commit on top of yours rather than leaving a list. The first half of it is the refusal you already fixed; here is the rest. A filtered miss said Query Store may be off. Most queries never abort, so Validation uses the house idiom. Both grids now split by outcome, not just Lite's. Lite keeps The filter runs before the dedup's Tests. The new Lite test seeded three different queries with one outcome each, so it could not see a blended plan. Budget ceiling. Your per-parameter lines were right. On the old base the Merge. dev is merged in ( Verified locally:
Not verified locally:
Suggested for the PR body (the combined CHANGELOG PR reads it from there): CHANGELOG entry
|
Dev's erikdarlingdata#3898 conversions moved get_query_store_top's reading guidance off tools/list, so the new execution_type parameter now fits under both SKUs' existing tools/list ceilings (Darling measures 251,004 bytes against 329,494). The +124-byte ceiling raises from the review commit are dropped in favour of dev's values.
The sentence rides the reading guide on both SKUs, after the <<GUIDE>> marker, so the tools/list head and its budget are unchanged.
erikdarlingdata#4060's execution_type erikdarlingdata#4060 gave get_query_store_top an execution_type filter on the same read, row type, parameters and filtered-miss path. The two are combined: - SQL: execution_type stays $6, filtered in the dedup CTE as erikdarlingdata#4060 placed it; module_name becomes $7, still applied after the dedup and before the ranking. Rows carry execution_type and module_name; Darling's QueryStoreRow reader maps all 17 columns in projection order. Lite binds the outcome, then the module, after the database list. - Parameters, both SKUs: ..., as_of, execution_type, module_name (the parity theory, the web catalog and the dispatch follow). - A filtered miss takes erikdarlingdata#4060's test for both filters: the same read without the filters, scoped to the database. It replaces this PR's server-wide window floor on Darling and Lite's HasQueryStoreRowsInWindowAsync, which is removed; erikdarlingdata#4060's probe answers the same question, scoped to the database the read was. An execution_type-only miss keeps erikdarlingdata#4060's message word for word; a miss with module_name goes through the new shared McpHelpers.QueryStoreModuleEmpty, which names both filters, and on Darling still carries the served window as hints. - The tool-guide tails (after <<GUIDE>>, so the budgeted heads are dev's) describe both filters and the one miss rule. - Tests: the Darling live pin gains a module plus execution_type miss; Lite gains a database + outcome + module binding test, and loses the removed probe's test.
Problem
Query Store records whether executions completed normally, were aborted, or ended with an exception, but the MCP read currently blends those populations and omits the outcome.
Value
Callers can isolate aborted and exception executions and see the outcome on every result without increasing broad result limits.
Summary
Validation