Skip to content

sp_QuickieStore: add @sort_order tiebreaker to @find_high_impact#705

Merged
erikdarlingdata merged 3 commits intodevfrom
feature/hi-sort-tiebreaker
Mar 23, 2026
Merged

sp_QuickieStore: add @sort_order tiebreaker to @find_high_impact#705
erikdarlingdata merged 3 commits intodevfrom
feature/hi-sort-tiebreaker

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • Uses existing @sort_order parameter as tiebreaker in @find_high_impact ORDER BY
  • Primary sort: impact_score DESC
  • Tiebreaker: matching share column DESC (cpu_share default, or duration/physical reads/writes/memory/executions)
  • No new parameters — reuses existing @sort_order

Test plan

  • SQL2022 — debug output confirms ORDER BY o.impact_score DESC, o.physical_reads_share DESC with @sort_order = 'physical reads'
  • Default falls through to cpu_share

🤖 Generated with Claude Code

erikdarlingdata and others added 3 commits March 23, 2026 16:15
sp_QuickieStore: split @find_high_impact to isolate OUTER APPLY
…R BY

When multiple queries have the same impact_score, the output order was
arbitrary. Now uses @sort_order to pick a tiebreaker column (cpu_share
by default, or duration/physical reads/writes/memory/executions share).

Tested on SQL2022 with @sort_order = 'physical reads' confirmed in
debug output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit bdadf63 into dev Mar 23, 2026
5 checks passed
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