SQL Plan For Dummies is an interactive SQL Execution Plan Viewer designed to provide visual analysis and performance insights for query execution plans. It helps users understand and optimize database queries by presenting detailed, actionable information in an intuitive interface.
Key Features:
Interactive Visualization: Utilizes D3.js for a dynamic tree layout that highlights key metrics like CPU time, I/O cost, and row counts through color-coded nodes.
Detailed Node Inspection: Users can examine individual query execution steps to identify bottlenecks, view predicates, and assess memory usage.
Automated Performance Analysis: Flags common issues such as table scans, missing indexes, and spills, offering immediate feedback for optimization.
Plan Comparison: Enables side-by-side analysis of different execution plans to evaluate performance differences and cost deltas.
Export Options: Supports exporting visualizations in PNG or SVG formats for reporting and sharing insights.
Audience & Benefit:
Ideal for SQL Server DBAs, developers, and data professionals seeking to improve query performance. By identifying inefficiencies and guiding optimizations, SQL Plan For Dummies empowers users to enhance database efficiency and reduce operational costs. It is a fast, lightweight desktop application that can be installed via winget, ensuring seamless integration into daily workflows.
README
SQL Plan For Dummies
An interactive SQL Execution Plan Viewer, SQL Editor and Extended Events Analyzer built with Tauri + Vue + D3.js that provides visual analysis and performance insights for query execution plans and XEL traces.
Get a plan: In SSMS, enable "Include Actual Execution Plan" (Ctrl+M), run your query, and save as .sqlplan - or connect to your server in the SQL Editor tab and run the query there
Analyze: Drag the .sqlplan file into the app and review performance insights
Features
The app has three top-level tabs: Plan Viewer, SQL Editor, and XEL Analyzer (Windows only).
Plan Viewer
Interactive D3.js Visualization: Color-coded nodes with performance indicators, operator icons, and dynamic line thickness
Detailed Node Inspection: CPU time, I/O cost, memory grants, row counts, predicates, and execution statistics with searchable properties
Plan Overview: Per-statement summary table (cost, elapsed, CPU, waits, warnings) for multi-statement plans, plus aggregated wait statistics and optimizer missing-index suggestions
Wait Statistics: Statement-level WaitStats and QueryTimeStats with plain-language explanations of each wait type
Blocking Detection: Lock waits (LCK_M_*) are flagged on the statement list and reported separately from plan cost, so a slow query blocked by another session is not mistaken for a bad plan
Multi-Statement Plans: Batches are merged into a single plan; statements can be sorted by cost or elapsed time
Plan Comparison: Side-by-side visual comparison with cost delta analysis
git clone https://github.com/PsyChonek/SqlPlanForDummies.git
cd SqlPlanForDummies
npm install
npm run tauri dev # Development
npm run tauri build # Production build
Prerequisites: Node.js 18+, Rust, WebView2
Other scripts:
npm run dev # Frontend only, in the browser (http://localhost:5173)
npm run build # Bump patch version, build the MSI, copy it to dist/
npm run build:minor # Same, bumping the minor version (also: build:major)
npm run build:frontend # Type-check and build the frontend only
npm run test # Vitest in watch mode (test:run for a single pass)
npm run test:coverage # Vitest with coverage
npm run test:rust # Cargo tests for the Tauri backend
Usage
Getting a Plan from SSMS:
Enable "Include Actual Execution Plan" (Ctrl+M)
Run your query
Right-click the plan → "Save Execution Plan As..." → .sqlplan
Analyzing Plans:
Load: Drag & drop .sqlplan file into the app
Overview: Open the Plan Overview tab to see all statements ranked by cost, elapsed time, waits, and warnings, then click one to jump to its graph
Navigate: Click/drag to pan, scroll to zoom, arrow keys to move between nodes
Inspect: Click nodes to view details, costs, and predicates
Search: Use the search box to filter node properties by keyword
Analyze: Switch to the Analysis tab for automated performance warnings and wait statistics
Compare: Load a second plan for side-by-side comparison
Export: Save as PNG or SVG
Running Queries (SQL Editor tab):
Connect: Click the connection status in the header and add a SQL Server connection
Write: Enter a query in the editor
Choose a plan type: None, Estimated, or Actual
Run: Execute the query and review results and messages in the output panel
Analyze: Captured plans open in the Plan Viewer; earlier runs stay in Query History
Analyzing Extended Events (Windows only):
Load: Drag & drop .xel or exported .xml Extended Events files
Browse: Filter and sort events in the event table
Timeline: View event distribution over time in the Gantt-style timeline
Deadlocks: Review detected deadlock graphs and victim processes
Blocking: Inspect blocking chain diagrams to find root blockers
Dashboard: Check wait statistics and problem summary metrics
Technology Stack
Frontend: Vue 3 + TypeScript + Vite + Tailwind CSS
Visualization: D3.js v7
SQL Editing: CodeMirror 6
Desktop: Tauri 2.0 (Rust + WebView2)
Testing: Vitest + Vue Test Utils
Supported: SQL Server 2012+ .sqlplan files (SSMS, Azure Data Studio). Wait statistics require actual plans from SQL Server 2016 SP1+
FAQ
Q: Is my data sent anywhere?
A: No. The app runs entirely offline on your machine, and it only talks to the SQL Server instances you connect to yourself.
Q: What file types are supported?
A: SQL Server .sqlplan execution plan files and .xel/.xml Extended Events files. XEL analysis requires Windows with PowerShell.
Q: My query is slow but the plan looks fine. Why?
A: Check the Waits column in Plan Overview. A lock icon means the statement was blocked by another session, so the time was spent waiting rather than executing.
Q: Does this work with PostgreSQL/MySQL?
A: Not yet. Only SQL Server formats are currently supported.
Contributions welcome! Fork the repo, create a feature branch, and open a PR. Follow the existing code style and conventions described in AGENTS.md, and run npm run test:run before opening the PR.