Address issue #178 round 3 feedback (items 17-25)#213
Merged
erikdarlingdata merged 4 commits intodevfrom Apr 9, 2026
Merged
Conversation
- #17: Bump SubTreeCost threshold from 0.01 to 1.0 (Rules 3 & 20) — CTFP is an integer - #18: Smarter MaxDOPSetToOne severity — check query text for MAXDOP 1, detect truncation - #19: Already fixed by #20 - #20: Scope "allocated resources" message to Hash/Sort/Spool operators only - #21: Fix non-SARGable false positive when function is on parameter side - #22: Enrich parallelism warnings with targeted wait stats advice - #23: Enrich scan-with-predicate with cost %, elapsed %, row selectivity; elevate to Critical Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
A Batch element can contain multiple <Statements> children (e.g., one for DECLARE and one for the SELECT). The parser used .Element() which only reads the first, causing "no plan loaded" when the actual query plan was in the second <Statements> block. Changed to .Elements() to iterate all of them. Reported by Joe Obbish via email (related to issue #178). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Statements with no QueryPlan (like DECLARE/ASSIGN) were filtered from the statement tab list because they had no RootNode. Now creates a synthetic root node with the appropriate icon (assign/declare) so they appear as tabs alongside the actual query plans. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rule 32 (actual plans): When an expensive scan (>= 50% of plan) has a >= 10x row overestimate and < 10% selectivity, flag that the bad estimate likely caused the optimizer to choose a scan over a seek. Rule 33 (estimated plans): Detect well-known CE default selectivity guesses (30%, 10%, 9%, ~16.4%, 1%) on expensive scans against large tables (>= 100K rows). These patterns suggest the optimizer is using a default guess instead of accurate statistics. Addresses issue #178 items #24 and #25 (Joe Obbish feedback). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Apr 9, 2026
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.
Summary
Addresses all items from Joe Obbish's round 3 feedback on issue #178, plus a parser bug fix.
PlanAnalyzer changes
Parser fixes
<Statements>parsing to iterate all children (multi-statement batches with DECLARE + SELECT)Test plan
🤖 Generated with Claude Code