A visualization tool for exploring SQL query execution plans using Icicle Plots. This tool addresses the limitations of traditional node-link diagrams by providing a space-efficient, interactive interface that makes it easier to identify performance bottlenecks, redundancy, and optimizer estimation errors in large query plans.
- Icicle Plot Visualization: Uses space-filling logic to represent query trees, eliminating whitespace and reducing the need for panning/zooming.
- Dual Encoding:
- Width: Visualize metrics like Subtree Cost, Subtree Time, or Subtree Size.
- Color: Highlight operators by Estimated Cost, Actual Time, Operator Type, or difference between any two metrics.
- Coordinated Views: Includes a traditional Node-Link view that stays in sync with the Icicle plot for users familiar with standard tools.
- Interactive Drill-Down: Click any node to focus on its specific subtree and access path.
- Supported Formats: Currently supports execution plans from Microsoft SQL Server and PostgreSQL.
For a walkthrough of the interface and workflows, watch the demo video:
This is a client-side web application built with vanilla JavaScript, HTML, and CSS. No complex build process or package manager (npm/yarn) is required.
- Clone the repository:
git clone https://github.com/mk3-20/interactive-query-plan-vis.git
- Navigate to the project directory:
cd interactive-query-plan-vis - Start a simple local HTTP server:
- Python 3:
python -m http.server 8080
- Node.js (http-server):
npx http-server
- Python 3:
- Open your browser and visit:
http://localhost:8080orhttp://127.0.0.1:8080/
- Launch the Tool: Open the interface in your web browser.
- Upload a Plan: You can open a plan in two ways:
- Drag & Drop: Simply drag a
.sqlplan(SQL Server) or.json/.csv(PostgreSQL) file directly onto the window to open it in a new tab. - Manual Selection: Open a new tab within the interface and select a file from your local storage.
- Drag & Drop: Simply drag a
- Analyze:
- Identify Bottlenecks: Set Color By to metrics like "Cost (Est.)" or "Time (Actual)" to instantly spot high-cost nodes based on the active color map intensity.
- Spot Redundancy: Set Size By to "Subtree Cost" and Color By to "Operator" to find symmetrical visual patterns that may indicate redundant operations.
- Check Estimates (Difference Mode): Use the Difference toggle to color nodes by the divergence between two metrics (e.g., Estimated Cost vs. Actual Time). The color scale (ranging from -1 to 1) allows you to visualize where the optimizer underestimated or overestimated performance.
Check out the hosted version here: https://mk3-20.github.io/interactive-query-plan-vis/
- Mukund Kukreja
- Jaydip Mokariya
- Vijay Natarajan
- Harish Doraiswamy