Skip to content

sp_QuickieStore: use staged query_ids in final plan OUTER APPLY#712

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/hi-plan-apply-use-staging
Mar 24, 2026
Merged

sp_QuickieStore: use staged query_ids in final plan OUTER APPLY#712
erikdarlingdata merged 1 commit intodevfrom
fix/hi-plan-apply-use-staging

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Final plan OUTER APPLY now uses #hi_id_staging_queries instead of correlating through query_store_query per row. Drops from 2 DMVs to 1 in the correlated subquery.

Test plan

  • SQL2022 — clean output, plans present

🤖 Generated with Claude Code

The OUTER APPLY correlated on query_hash through query_store_query
for each output row. Now uses #hi_id_staging_queries (already populated)
to skip query_store_query entirely — 1 DMV instead of 2, correlating
against a known-small temp table.

Tested on SQL2022.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant