Skip to content

Add benefit scoring for parallel skew and key lookup NL join#231

Merged
erikdarlingdata merged 2 commits into
devfrom
fix/joe-feedback-scoring
Apr 16, 2026
Merged

Add benefit scoring for parallel skew and key lookup NL join#231
erikdarlingdata merged 2 commits into
devfrom
fix/joe-feedback-scoring

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

  • a17: Parallel Skew (Rule 8) now gets MaxBenefitPercent via operator's own elapsed time, same pattern as other operator-time rules. Previously listed as "stays null" in the scorer.
  • a4: Key Lookup / RID Lookup benefit now includes the parent Nested Loops join when the NL is purely a lookup driver (inner child = lookup, outer child = simple seek/scan with no subtree). For Joe's example plan, this means the key lookup benefit reflects the full cost of the lookup pattern, not just the seek-back operator in isolation.

Test plan

  • 75 existing tests pass
  • Run Joe's plan and verify parallel skew warnings now show benefit %
  • Verify key lookup benefit is higher when parent NL is a simple lookup driver
  • Verify key lookups inside complex NL joins (multiple children, subqueries) are NOT inflated

🤖 Generated with Claude Code

erikdarlingdata and others added 2 commits April 15, 2026 23:50
- a17: Parallel Skew (Rule 8) now gets benefit scoring using operator's
  own elapsed time as % of statement elapsed, same as other operator-time
  rules
- a4: Key Lookup benefit now includes the parent Nested Loops join when
  the NL only exists to drive the lookup (inner=lookup, outer=simple
  seek/scan with no children). Handles both actual and estimated plans.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Joe changed his mind on a17: parallel skew should be a property of each
operator (consolidated with other improvements) rather than a standalone
benefit score. Reverting the Parallel Skew dispatch; keeping the key
lookup NL join scoring (a4).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit c355262 into dev Apr 16, 2026
2 checks passed
@erikdarlingdata erikdarlingdata deleted the fix/joe-feedback-scoring branch April 19, 2026 00:25
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