sql-plan-audit

Run EXPLAIN QUERY PLAN on sqlc-style catalogs and diff plans against a baseline.

320|3|Updated Apr 24, 2026
One-click install
npx skills add https://github.com/mizchi/skills --skill sql-plan-audit
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-plan-audit
Source: https://github.com/mizchi/skills/tree/main/sql/plan-audit
Command: npx skills add https://github.com/mizchi/skills --skill sql-plan-audit

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires node:sqlite, and includes scripts (resource) components.

What problem does it solve?

Run EXPLAIN QUERY PLAN against every query in a sqlc-style catalog and diff the plans against a baseline to detect new full-table SCANs and TEMP B-TREE sort scans introduced by PRs. SQLite/D1-only today; engine extension noted below.

Core Features & Use Cases

  • Identify plan changes across a PR by comparing planner output for all catalog queries.
  • Surface regressions such as new SCANs or TEMP B-TREE usage that impact performance.
  • Provide a CI-friendly JSON or text report for diffs and reviews.

Quick Start

Run the explain-runner with a schema file and a sqlc-style query catalog to generate a plan-diff report.

Frequently Asked Questions about sql-plan-audit

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I detect SQLite query plan regressions in a pull request?

To detect SQLite query plan regressions in a pull request, run EXPLAIN QUERY PLAN on a sqlc-style catalog and diff the output against a baseline to surface new SCANs or TEMP B-TREE usage.

What is EXPLAIN QUERY PLAN diffing for sqlc queries?

EXPLAIN QUERY PLAN diffing for sqlc queries is the process of comparing SQLite planner output against a baseline to identify performance changes, such as new full-table SCANs introduced by schema or query modifications.

How do I set up SQLite query plan auditing for CI pipelines?

Set up SQLite query plan auditing for CI pipelines by providing a schema file and a sqlc-style query catalog with name markers to generate JSON or text report diffs suitable for automated PR reviews.

Does EXPLAIN QUERY PLAN diffing work with databases other than SQLite?

EXPLAIN QUERY PLAN diffing is currently limited to SQLite and D1 projects, as it relies on the node:sqlite dependency to evaluate planner decisions and detect changes like new SCANs or TEMP B-TREE usage.

What do I need to generate a SQL plan diff report?

To generate a SQL plan diff report, you need a schema file and a sqlc-style queries catalog containing name markers, which the runner uses to execute EXPLAIN QUERY PLAN and emit CI-friendly diffs.