reviewing-sql-performance

Analyze EXPLAIN ANALYZE output to identify inefficient SQL queries and recommend indexing strategies.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/somachak/claude-code-skills-db --skill reviewing-sql-performance
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: reviewing-sql-performance
Source: https://github.com/somachak/claude-code-skills-db/tree/main/skills/data/reviewing-sql-performance
Command: npx skills add https://github.com/somachak/claude-code-skills-db --skill reviewing-sql-performance

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Slow SQL queries degrade API responsiveness, dashboards latency, and analytics throughput. This skill helps identify inefficient plans, missing indexes, and costly scans, enabling targeted rewrites and indexing strategies.

Core Features & Use Cases

  • Analyze EXPLAIN ANALYZE output to assess plan quality and identify sequential scans, high-cost operations, and poor join order.
  • Recommend indexing and query rewrites to reduce execution time and resource usage.
  • Suitable for API backends, data pipelines, reporting jobs, and analytics workloads experiencing latency or high CPU/disk I/O.

Quick Start

Run EXPLAIN ANALYZE on a slow query and apply the recommended indexing strategy.

Frequently Asked Questions about reviewing-sql-performance

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

FAQPage Schema
How do I optimize slow SQL queries causing high latency in my API backend?

To optimize slow SQL queries, you must read the EXPLAIN ANALYZE execution plan to identify costly sequential scans and poor join order. This skill assesses index usage and recommends targeted query rewrites to reduce execution time and resource usage.

What is the best way to analyze a Postgres execution plan for missing indexes?

Analyzing a Postgres execution plan involves running EXPLAIN ANALYZE to expose high-cost operations and sequential scans. This skill evaluates the output to pinpoint missing indexes and suggests indexing strategies to lower disk I/O and CPU consumption.

Can I use this to fix query performance issues in MySQL reporting jobs?

Yes, this skill diagnoses query performance issues in MySQL reporting jobs by evaluating execution plans. It identifies inefficient plans and costly scans, recommending indexing and query rewrites to improve analytics throughput.

How do I reduce database costs and CPU usage for heavy analytics pipelines?

Reducing database costs for analytics pipelines requires identifying inefficient SQL queries that cause high CPU and disk I/O. By assessing execution plans and applying recommended indexing strategies, you can significantly lower resource usage.

Why does my database execution plan show a sequential scan instead of using an index?

A sequential scan appears in an execution plan when indexes are missing, poorly designed, or unused by the query planner. This skill analyzes your EXPLAIN ANALYZE output to detect these costly scans and recommends appropriate indexing strategies.

Do I need to provide the EXPLAIN ANALYZE output to find poor join order in my queries?

Yes, providing the EXPLAIN ANALYZE output is required to assess plan quality and identify poor join order. This skill depends on reading execution plans to recommend query rewrites and indexing strategies for faster database performance.