Skip to content

Row Estimate Mismatch (rule 5) warns on operators that never executed #4522

Description

@erikdarlingdata

Part of #4511, the sync of plan analysis changes from PerformanceStudio (PS) to PerformanceMonitor (PM).

Rule 5 (PlanAnalyzer.cs:527) checks node.HasActualStats && node.EstimateRows > 0 && !node.Lookup, but not ActualExecutions. An operator in a branch that never ran returns 0 rows because it never executed. The rule then reports a Row Estimate Mismatch, but 0 rows from an operator that never ran says nothing about the estimate.

erikdarlingdata/PerformanceStudio@cc18844 (erikdarlingdata/PerformanceStudio#577) adds node.ActualExecutions > 0 to the condition. erikdarlingdata/PerformanceStudio@de1cac6 then removes the ActualExecutions > 0 ? ActualExecutions : 1 fallback inside the rule, because the new condition makes it unreachable. In PM, the fallback is at line 549.

Add the condition at line 527 and remove the fallback at line 549. Size S.

At 1899737f. dev has no later change to PerformanceMonitor.PlanAnalysis.

Activity

  1. added a commit that references this issue on Sep 28, 2026
    976a3b7
  2. erikdarlingdata commented on Sep 28, 2026

    @erikdarlingdata
    OwnerAuthor

    Claude posting for Erik Darling.

    Fixed by #4542 (976a3b7), so this issue is closing. Rule 5 (row estimate mismatch) no longer fires on an operator that never executed, as in PerformanceStudio (cc18844, de1cac6).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions