Skip to content

Commit 41eb187

Browse files
Add @query_plan_xml parameter to sp_QueryReproBuilder
New parameter lets callers feed a single query plan XML directly, bypassing Query Store entirely. Useful for isolating plans that are slow to parse and iterating on them without repeatedly hitting Query Store. When @query_plan_xml is supplied: - Database existence check is skipped - Query Store existence check is skipped - The entire Query Store population region is skipped (wrapped in IF @query_plan_xml IS NULL) - One synthetic row is seeded into each of #query_store_plan, #query_store_query, #query_store_query_text, #query_store_runtime_stats, and #query_context_settings with plan_id/query_id = -1 so synthetic rows cannot collide with real Query Store data - Statement text is extracted from the plan's StmtSimple/@StatementText to feed #query_store_query_text - The existing parameter extraction, warnings, embedded-constants, and repro-build phases all run unmodified against the synthetic data USE-database scaffold in the generated repro is gated on @database_name being supplied so synthetic-mode output doesn't emit 'USE NULL;'. Tested end-to-end against a parameterized HammerDB plan: @query_plan_xml round-trips through the parser and produces the parameter name/type/value plus the full repro scaffold. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent a376719 commit 41eb187

1 file changed

Lines changed: 320 additions & 40 deletions

File tree

0 commit comments

Comments
 (0)