Repository navigation
Plan analysis: drop three rules PerformanceStudio removed, and show its CPU:Elapsed ratio (#4537) - #4565
Merged
Conversation
…ism and Parallel Wait Bottleneck rules, matching PerformanceStudio (#4537) Rule 21 (CTE Multiple References) guessed at CTE reuse from statement text; an actual plan's own runtime stats already show where time went. Rules 25 (Ineffective Parallelism) and 31 (Parallel Wait Bottleneck) guessed at parallelism efficiency causes that the wait stats list and the runtime summary's new CPU:Elapsed ratio already show directly.
… PerformanceStudio's Moved the CPU:Elapsed row so it sits right after Elapsed, and made its CPU value subtract external-wait time before dividing, matching erikdarlingdata/PerformanceStudio@28d4c74. The ratio is now computed by a small pure helper (PlanDisplayText.CpuElapsedRatio) so it can be pinned without a WPF host.
Adds back the three rule-removal tests (CTE Multiple References, Parallel Wait Bottleneck, Ineffective Parallelism) alongside the four CPU:Elapsed ratio tests, so all seven pins for this change live in one class.
erikdarlingdata
marked this pull request as ready for review
September 28, 2026 13:37
This was referenced Sep 28, 2026
Closed
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #4537
Part of #4511
Why
PerformanceStudio removed three plan-analysis rules after its rule-set review (erikdarlingdata/PerformanceStudio#215). PerformanceMonitor still ran them. The two analyzers are meant to be equivalent, so this removes them here too.
What changes
PlanAnalyzer:BenefitScorer: removes the rule 25 and rule 31 scoring cases.Resources/WaitStats.json(WaitStatsConfig.Description), andEmitWaitStatWarningssets noActionableFix. That is PerformanceStudio's current shape.BenefitScorer.IsExternalWait), as PerformanceStudio does.PlanDisplayText.CpuElapsedRatio, so it can be tested without a WPF host.IsLegacy, shown as " [legacy]") is its own change, Port PerformanceStudio's legacy-rule marker: IsLegacy on warnings from pre-framework rules, shown as [legacy] #4566.Test plan
Darling/Darling.Tests/PlanSync4537Tests.cshas seven tests:Three rule-removal tests, one per removed rule. Each builds the plan shape that fired the rule on
dev:Each asserts the finding is gone. All three were RED on
dev, in a detached worktree, and GREEN here. Mutation: restoring the rule 25/31 block turned both of their tests RED.Four CpuElapsedRatio tests:
Mutation: removing the external-wait subtraction turned two of them RED.
Run:
PlanSync4537Tests7/7. The full plan-analysis class list: 238 passed, 0 failed, and 2 skipped (live PostgreSQL, run in CI).Builds: Darling.Tests, PerformanceMonitor.Ui, Lite, Lite.Tests and Dashboard.Tests (Release,
EnableWindowsTargeting) all have 0 warnings.CHANGELOG
SECTION: Changed
ENTRY: - Plan analysis drops three rules that PerformanceStudio removed ([#4565]) - CTE Multiple References, Ineffective Parallelism and Parallel Wait Bottleneck are no longer reported. They guessed at what the runtime stats and wait stats already show. The plan viewer's runtime summary shows a CPU:Elapsed ratio instead, with external-wait time left out of CPU, as PerformanceStudio does.
REF: [#4565]: #4565