Skip to content

sp_QuickieStore: use plan_id PK seek in final OUTER APPLY#713

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

sp_QuickieStore: use plan_id PK seek in final OUTER APPLY#713
erikdarlingdata merged 1 commit intodevfrom
fix/hi-plan-apply-pk-seek

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Final OUTER APPLY now uses #hi_id_staging_plans (plan_id) instead of #hi_id_staging_queries (query_id). This allows a direct PK seek on query_store_plan instead of joining through query_id.

Test plan

  • SQL2022 — clean output, plans present

🤖 Generated with Claude Code

The OUTER APPLY was joining #hi_id_staging_queries → query_store_plan
by query_id. Now uses #hi_id_staging_plans which has the plan_ids
directly, allowing a PK seek on query_store_plan instead of a
query_id join.

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