Skip to content

sp_QuickieStore: stage interval IDs for @find_high_impact runtime stats#716

Merged
erikdarlingdata merged 1 commit intodevfrom
fix/hi-stage-intervals
Mar 24, 2026
Merged

sp_QuickieStore: stage interval IDs for @find_high_impact runtime stats#716
erikdarlingdata merged 1 commit intodevfrom
fix/hi-stage-intervals

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • New #hi_intervals temp table stages matching interval IDs (1 DMV, tiny result)
  • Runtime stats aggregation uses EXISTS semi-join against temp table instead of joining qsrsi directly
  • Eliminates the DMV-to-DMV join that caused bad optimizer choices

Test plan

  • SQL2022 — same results
  • SQL2016 — same results

🤖 Generated with Claude Code

Step 1a now stages matching runtime_stats_interval IDs into
#hi_intervals (tiny result set from 1 DMV), then Step 1b aggregates
runtime_stats with EXISTS against the temp table instead of joining
the two DMVs directly.

Tested on SQL2022 and SQL2016.

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