Skip to content

Split ShowPlanParser.cs into partial classes#331

Merged
erikdarlingdata merged 37 commits into
devfrom
feature/split-showplanparser
May 13, 2026
Merged

Split ShowPlanParser.cs into partial classes#331
erikdarlingdata merged 37 commits into
devfrom
feature/split-showplanparser

Conversation

@erikdarlingdata
Copy link
Copy Markdown
Owner

Summary

Move-only refactor of PlanViewer.Core/Services/ShowPlanParser.cs (1,844 lines) into 4 partial-class files.

File sizes

File Lines Contents
ShowPlanParser.cs (main) 628 Class declaration, XML namespace, Parse entry, ParseStatementAndChildren, ParseStatement, ParseStmtAttributes, ParseQueryPlanElements, ParseQueryPlanAsStatement
.RelOp.cs 789 ParseRelOp (~760-line operator dispatch) + GetOperatorElement + FindChildRelOps
.Warnings.cs 323 ParseWarnings, ParseWarningsFromElement, ParseMissingIndexes
.Costs.cs 25 ComputeOperatorCosts, ComputeNodeCosts
.Helpers.cs 66 CleanTempTableName, IsHexDigit, ScopedDescendants, ParseColumnList, FormatColumnRef, ParseDouble, ParseLong

Behavior

  • Move-only. No method bodies were modified.
  • Class made partial (was public static class).
  • PlanViewer.Web.csproj updated to link the new partial files.

Test plan

  • dotnet build PlanViewer.sln — 0 errors, 0 warnings
  • dotnet test tests/PlanViewer.Core.Tests — parser/analyzer test suite passes
  • Parse and render a complex actual plan (cursors, IF/ELSE, parameterization)
  • Parse and render an estimated plan

🤖 Generated with Claude Code

erikdarlingdata and others added 30 commits April 7, 2026 11:43
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Uses the Darling Data barbell logo as hero image when shared on
social media. Also adds meta description for SEO.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Add Open Graph meta tags for social sharing
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Merge dev: HTML export for plan analysis (#182)
This reason means something in the query blocks parallelism (scalar UDFs,
table variable inserts, etc.) — that's worth a Warning, not Info.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fix Rule 3: CouldNotGenerateValidParallelPlan stays Warning
Adds human-readable messages for all 25 known reasons. Severity:
- Warning: actionable reasons (UDFs, cursors, table variables, remote
  queries, trace flags, hints, DML OUTPUT, writeback variables)
- Info: passive/environmental (cost below threshold, edition limits,
  memory-optimized tables, upgrade mode, index build edge cases)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Expand Rule 3 to cover all NonParallelPlanReason values
Merge dev: plan sharing and export (#182)
Merge dev to main (v1.4.3 + logo fix)
Merge dev: HTTPS plan sharing API
Release: issue #178 round 3 feedback (items 17-25)
Release v1.5.0 — maximum benefit scoring
Release: analytics for Plan Analyzer web app
Merge dev to main — Joe #215 feedback through b1/b7
Release v1.7.0 — wait stats as warnings
Release v1.7.1 — render benefit % and actionable fix
Release v1.7.2 — operator self-time fix + decimal benefit %
Release v1.7.3 — visible web viewer version
Release v1.7.4 — external-wait formula + CPU:Elapsed adjustment
erikdarlingdata and others added 7 commits April 22, 2026 13:21
Release v1.7.6 — C1 memory color + C4 compile time + C8 expensive-op + C9 columnstore
Release v1.7.7 — D3 content strip + legacy marker + drop Rule 21
Release v1.7.8 — batch-mode pipelined self-time (#215 D1)
Release v1.8.0 — Joe feedback E1-E12 batch
Move-only refactor; no behavior changes. ShowPlanParser.cs (1,844 lines)
split into 4 partials:

  RelOp      (789) - ParseRelOp (~760-line workhorse) +
                     GetOperatorElement + FindChildRelOps
  Warnings   (323) - ParseWarnings + ParseWarningsFromElement +
                     ParseMissingIndexes
  Costs      ( 25) - ComputeOperatorCosts + ComputeNodeCosts
  Helpers    ( 66) - CleanTempTableName, IsHexDigit, ScopedDescendants,
                     ParseColumnList, FormatColumnRef, ParseDouble/Long

Main file now 628 lines — class declaration, XML namespace, the public
Parse entry, ParseStatement{,AndChildren,Attributes},
ParseQueryPlanElements / ParseQueryPlanAsStatement.

PlanViewer.Web.csproj updated to link the new partial files.

Build clean: 0 errors, 0 warnings on PlanViewer.sln.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@erikdarlingdata erikdarlingdata changed the base branch from main to dev May 13, 2026 03:17
@erikdarlingdata erikdarlingdata merged commit 973a8e4 into dev May 13, 2026
3 of 4 checks passed
@erikdarlingdata erikdarlingdata deleted the feature/split-showplanparser branch May 13, 2026 03:30
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