Feature/statistics summary#90
Open
Blake-goofy wants to merge 4 commits intoAxial-SQL:mainfrom
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a new “Statistics Summary” tool window to Axial SQL Tools that captures the latest visible SET STATISTICS IO (and optional SET STATISTICS TIME) output from SSMS, parses it, and presents totals plus per-table breakdowns for easier query tuning/comparisons.
Changes:
- Introduces a new tool window (XAML + view model) and a backing store for loading/capture state.
- Implements parsing for
SET STATISTICS IO/TIMEtext and wires capture into SSMS execution events viaGridAccess/package hooks. - Adds a VSCT command + icon, project file inclusions, and optional local
.vscodebuild/reinstall tasks.
Reviewed changes
Copilot reviewed 14 out of 15 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
| AxialSqlTools/StatisticsSummary/StatisticsSummaryWindowControl.xaml.cs | Tool window control lifecycle, store subscription, and UI refresh wiring |
| AxialSqlTools/StatisticsSummary/StatisticsSummaryWindowControl.xaml | Statistics Summary UI layout (totals, table grid, source info/query expander) |
| AxialSqlTools/StatisticsSummary/StatisticsSummaryWindowCommand.cs | Command to open the Statistics Summary tool window |
| AxialSqlTools/StatisticsSummary/StatisticsSummaryWindow.cs | Tool window pane + frame notifications for open/close lifecycle |
| AxialSqlTools/StatisticsSummary/StatisticsSummaryViewModel.cs | View model that formats store/summary data for the UI |
| AxialSqlTools/StatisticsSummary/StatisticsSummaryStore.cs | Shared state store for summary + capture/loading flags |
| AxialSqlTools/StatisticsSummary/StatisticsSummaryParser.cs | Regex-based parsing of STATISTICS IO/TIME output into a summary model |
| AxialSqlTools/StatisticsSummary/StatisticsSummary.cs | Summary/table model types used by parser/store/view model |
| AxialSqlTools/Modules/GridAccess.cs | Reflection-based retrieval/flush of SSMS statistics text from results/messages surfaces |
| AxialSqlTools/AxialSqlToolsPackage.vsct | Adds the Statistics Summary menu command + icon registration |
| AxialSqlTools/AxialSqlToolsPackage.cs | Hooks execution events and implements capture/retry/cancel logic feeding the store |
| AxialSqlTools/AxialSqlTools.csproj | Includes new Statistics Summary files and runtime identifier properties |
| .vscode/tasks.json | Local tasks for building and reinstalling the extension |
| .vscode/axial-extension.ps1 | Local PowerShell automation for build/reinstall via MSBuild/VSIXInstaller |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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.
Statistics Summary for SET STATISTICS IO/TIME output
Why I made this
When I am writing SQL, I often want to compare two ways to write the same query. Using
SET STATISTICS IO ON;is one of the best ways to see which version is better because it shows how many reads SQL Server had to do. When a query is slow, the table-by-table breakdown can also help point to the part of the query that needs attention.The problem is that the raw statistics output in SSMS is just a dense block of text. It is hard to scan, and if a table appears multiple times you have to manually add those reads together to understand the real total. This change solves that by summarizing the output and presenting it in a much more user-friendly way.
What this adds
This PR adds a new Statistics Summary tool window in Axial SQL Tools.
The window captures the most recent visible
SET STATISTICS IOand optionalSET STATISTICS TIMEoutput, parses it, and displays:This makes it much easier to compare query rewrites, spot which tables are driving IO, and understand where to focus tuning effort.
Screenshot
Behavior and implementation notes
SET STATISTICS TIME ON;is optional. If time output is present, elapsed time and CPU time are included in the summary.Considerations during implementation
Note about the .vscode files
This PR also includes
.vscodefiles that I use for local development in VS Code.How to test
SET STATISTICS IO ON;.SET STATISTICS TIME ON;if you want elapsed time and CPU time included.SET STATISTICS TIME ON;was included, confirm elapsed time and CPU time are shown.Expected outcome
Reviewers should be able to see that this feature turns hard-to-read SSMS statistics text into a practical tuning view that is useful for comparing query approaches and identifying which tables are responsible for the most reads.