sql-optimization-patterns

Analyze SQL execution plans and apply optimization patterns for PostgreSQL and MySQL.

1|Updated Jan 17, 2026
One-click install
npx skills add https://github.com/kurokeita/ai-agent --skill sql-optimization-patterns-kurokeita
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-optimization-patterns
Source: https://github.com/kurokeita/ai-agent/tree/main/skills/sql-optimization-patterns
Command: npx skills add https://github.com/kurokeita/ai-agent --skill sql-optimization-patterns-kurokeita

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve?

This Skill helps database engineers and software developers systematically reduce slow SQL queries by analyzing execution plans, identifying bottlenecks, and applying proven patterns to improve performance and scalability.

Core Features & Use Cases

  • Query plan analysis and interpretation to locate inefficiencies.
  • Indexing and data access patterns to reduce I/O and execution time.
  • Use Case: Debugging slow queries and redesigning schemas to support high-throughput applications.

Quick Start

Analyze a slow query using EXPLAIN ANALYZE, implement a targeted index and pattern-based rewrite, and re-run EXPLAIN ANALYZE to verify performance improvements.

Frequently Asked Questions about sql-optimization-patterns

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

FAQPage Schema
How do I analyze SQL execution plans to fix slow queries?

To analyze SQL execution plans, run EXPLAIN or EXPLAIN ANALYZE on your slow query to locate bottlenecks, then apply targeted indexing and pattern-based rewrites to reduce I/O and execution time.

What are the best SQL optimization patterns for high-traffic PostgreSQL and MySQL workloads?

The best SQL optimization patterns for high-traffic PostgreSQL and MySQL workloads involve interpreting execution plans, implementing targeted data access indexes, and rewriting queries to minimize I/O and improve scalability.

Why does my database query require a full table scan and how do I optimize it?

Your database query requires a full table scan due to missing indexes or inefficient data access patterns. Optimize it by analyzing the execution plan and applying targeted indexes to reduce I/O operations.

Can I use this approach to redesign database schemas for high-throughput applications?

Yes, you can use this execution plan analysis and indexing approach to redesign database schemas, enabling efficient data access patterns tailored for high-throughput PostgreSQL and MySQL applications.

What's the best way to verify SQL performance improvements after indexing?

The best way to verify SQL performance improvements is to re-run EXPLAIN ANALYZE after implementing a targeted index and pattern-based rewrite, confirming the execution plan changes satisfy your performance goals.

How do indexing strategies reduce I/O bottlenecks in database optimization?

Indexing strategies reduce I/O bottlenecks in database optimization by replacing full table scans with direct data access patterns, drastically lowering execution time and improving workload scalability.