Skip to content

Sync PlanAnalyzer + BenefitScorer from PerformanceStudio (Apr 9-16)#856

Merged
erikdarlingdata merged 1 commit into
devfrom
sync/planalyzer-from-ps-apr16
Apr 16, 2026
Merged

Sync PlanAnalyzer + BenefitScorer from PerformanceStudio (Apr 9-16)#856
erikdarlingdata merged 1 commit into
devfrom
sync/planalyzer-from-ps-apr16

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Syncs all PlanAnalyzer and BenefitScorer changes from PerformanceStudio since the last sync (PR #818, Apr 9). Covers PerformanceStudio PRs #216, #217, #219, #224, #229, #230, #231.

PlanAnalyzer changes (Dashboard + Lite)

  • Rule 5: Suppress Row Estimate Mismatch for Lookup operators
  • Rule 8: Batch mode sort awareness + practical skew guidance
  • Rule 9: Top 3 memory consumers by row count instead of full list
  • Rule 10: Key Lookup overhaul — output columns, predicate filtering check, softer advice
  • Rules 11/12/29: Suppress on 0-execution nodes
  • Rule 11: I/O wait severity elevation
  • Rule 24: FormatNodeRef for richer node references with object names
  • Rule 26: Suppress when row goal worked; specific cause detection from statement text
  • Rule 31: Use actual wait stats instead of generic causes
  • New helpers: GetWaitLabel, HasSignificantIoWaits, FormatNodeRef, IdentifyRowGoalCause
  • GetOperatorOwnElapsedMs changed to internal for BenefitScorer access

BenefitScorer (NEW — Dashboard + Lite)

  • Stage 1: Operator-level benefit scoring (MaxBenefitPercent) for Rules 1-5, 7, 9-12, 16, 19, 25, 31, 32
  • Stage 2: Wait stats benefit scoring with parallel-aware allocation (Joe's formula)
  • Key Lookup benefit includes parent NL join when it's a simple lookup driver

PlanModels additions (Dashboard + Lite)

  • MaxBenefitPercent and ActionableFix on PlanWarning
  • WaitBenefit class + WaitBenefits list on PlanStatement

Test plan

  • Dashboard builds clean (0 errors)
  • Lite builds clean (0 errors)
  • Dashboard and Lite PlanAnalyzer identical (namespace only)
  • Dashboard and Lite BenefitScorer identical (namespace only)
  • Test plan analysis in Dashboard UI
  • Test plan analysis in Lite UI

🤖 Generated with Claude Code

Port PS PRs #216, #217, #219, #224, #229, #230, #231 to PM.

PlanAnalyzer changes:
- Rule 5: Suppress for Key Lookups (point lookups mislead per-execution estimates)
- Rule 8: Enhanced parallel skew with batch mode sort detection and practical context
- Rule 9: Large memory grant shows top 3 consumers sorted by row count
- Rule 10: Key lookup overhaul — show output columns, check predicate filtering, softer advice
- Rules 11/12/29: Suppress on 0-execution nodes (operator never ran)
- Rule 11: I/O wait severity elevation when scan hits disk
- Rule 24: FormatNodeRef helper includes object name for data access operators
- Rule 26: Suppress when row goal prediction was correct, specific cause detection
- Wait stats: DescribeWaitType with full wait type coverage, multi-wait summary
- New helpers: GetWaitLabel, HasSignificantIoWaits, IdentifyRowGoalCause, FormatNodeRef
- GetOperatorOwnElapsedMs changed to internal for BenefitScorer access

BenefitScorer (new file):
- Stage 1: MaxBenefitPercent for operator-level rules (filter, spill, lookup, etc.)
- Stage 2: Wait stats benefit scoring with parallel allocation (Joe's formula)

PlanModels additions:
- MaxBenefitPercent and ActionableFix on PlanWarning
- WaitBenefit class and WaitBenefits list on PlanStatement

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata merged commit 41f182f into dev Apr 16, 2026
3 checks passed
@erikdarlingdata erikdarlingdata deleted the sync/planalyzer-from-ps-apr16 branch April 19, 2026 00:35
pull Bot pushed a commit to ehtick/PerformanceMonitor that referenced this pull request Apr 29, 2026
…manceStudio

Ports PerformanceStudio PRs erikdarlingdata#285 and erikdarlingdata#288 (net result; the temporary R/D/G
overlay from erikdarlingdata#285 was replaced by real icons in erikdarlingdata#288).

PlanIconMapper.GetIconName now takes optional storageType and logicalOp:
- Columnstore scans (Clustered/Index Scan with Storage="ColumnStore" on the
  Object element) route to the columnstore_index_* icons. Covers both CCI
  and NCCI for scan/delete/insert/update/merge.
- The three Parallelism subtypes (Repartition/Distribute/Gather Streams)
  route to their own icons instead of all sharing parallelism.png.

ShowPlanParser: the IconName assignment moves from immediately after PhysicalOp
parsing to after StorageType and LogicalOp are populated, so the new routing
has the inputs it needs.

Three new icons (MIT-licensed contribution from @rferraton via PS erikdarlingdata#288) added
to both Dashboard and Lite Resources/PlanIcons. The existing Resource glob
in each csproj picks them up automatically.

Last upstream sync from PerformanceStudio was 2026-04-16 (erikdarlingdata#856), scoped to
PlanAnalyzer + BenefitScorer. This is a follow-up scoped to plan-viewer
icon routing.

Co-Authored-By: Claude Opus 4.7 (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