Skip to content

Fix/querystore improvment and fixes 202603#148

Merged
erikdarlingdata merged 4 commits intoerikdarlingdata:devfrom
rferraton:fix/querystore-improvment-and-fixes-202603
Mar 26, 2026
Merged

Fix/querystore improvment and fixes 202603#148
erikdarlingdata merged 4 commits intoerikdarlingdata:devfrom
rferraton:fix/querystore-improvment-and-fixes-202603

Conversation

@rferraton
Copy link
Contributor

What does this PR do?

  • fix bug on grid fetch due to order by command that use a table alias. In the optimized query that are no more relevant and cause one query to crash for the grid data fetch
  • fix timerange slicer handle selection
  • improve wait stats getter by using a temp table to store the top elected plans
  • add 2 progress bars

Which component(s) does this affect?

  • Desktop App (PlanViewer.App)
  • Core Library (PlanViewer.Core)
  • CLI Tool (PlanViewer.Cli)
  • SSMS Extension (PlanViewer.Ssms)
  • Tests
  • Documentation

How was this tested?

2026-03-26_22h21_19

2026-03-26_22h22_28

Describe the testing you've done. Include:

  • Plan files tested : QueryStore
  • Platforms tested : Windows only

Checklist

  • I have read the contributing guide
  • My code builds with zero warnings (dotnet build -c Debug)
  • All tests pass (dotnet test)
  • I have not introduced any hardcoded credentials or server names

… plan grid and try improve performance of querystore grid fetch
FetchPlanWaitStatsAsync now accepts an optional planIds parameter. When provided, the method creates a temp table and filters results to only those plan IDs for efficient querying. SQL construction and connection logic were refactored to support this feature.
Copy link
Owner

@erikdarlingdata erikdarlingdata left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good — fixes a real bug in the phase 4 ORDER BY (alias mismatch from #145), plus the wait stats split, progress bars, and handle hit zones from #146 done cleanly on top of current dev.

Minor nits for follow-up:

  • globalWaitTask assigned but never awaited (line 191) — should be _ = FetchGlobalWaitStatsOnlyAsync(...) for fire-and-forget clarity
  • Debug.WriteLines still in catch blocks
  • orderClause alias stripping (ps. → bare) is unnecessary but harmless

None blocking. Thanks @rferraton!

@erikdarlingdata erikdarlingdata merged commit b8678d0 into erikdarlingdata:dev Mar 26, 2026
2 checks passed
erikdarlingdata added a commit that referenced this pull request Mar 26, 2026
- Fix fire-and-forget: globalWaitTask variable replaced with _ = discard
- Remove Debug.WriteLines from wait stats catch blocks, add separate
  OperationCanceledException handler for clean cancellation
- Remove unused System.Diagnostics using
- Restore ps. prefix on orderClause (used in ranked CTE where ps is
  the correct alias for #plan_stats)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
erikdarlingdata added a commit that referenced this pull request Mar 26, 2026
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.

2 participants