sql-optimization-minimal

Diagnose slow SQL queries with EXPLAIN ANALYZE and apply indexing optimizations.

2|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/snoodleboot-io/prompticorn --skill sql-optimization-minimal
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-optimization-minimal
Source: https://github.com/snoodleboot-io/prompticorn/tree/main/prompticorn/skills/sql-optimization/minimal
Command: npx skills add https://github.com/snoodleboot-io/prompticorn --skill sql-optimization-minimal

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill provides essential techniques for diagnosing and optimizing slow SQL queries, helping you to enhance database performance.

Core Features & Use Cases

  • EXPLAIN ANALYZE: Diagnose query performance with detailed execution plans.
  • Add Indexes: Enhance query speed by adding indexes.
  • Avoid N+1 Queries: Optimize for more efficient data retrieval.
  • Limit & Pagination: Efficiently fetch data subsets with pagination.
  • Use Appropriate Data Types: Choose optimal data types for performance.
  • Use Case: A database administrator can use this Skill to identify slow queries and apply the recommended optimizations, significantly improving database performance.

Quick Start

Run the EXPLAIN ANALYZE command on a slow SQL query to identify performance bottlenecks.

Frequently Asked Questions about sql-optimization-minimal

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

FAQPage Schema
How do I diagnose slow SQL query performance bottlenecks?

Diagnose slow SQL query performance by running the EXPLAIN ANALYZE command to generate detailed execution plans, which reveal specific bottlenecks like full table scans or inefficient indexing strategies.

What is the best way to avoid N+1 queries for efficient data retrieval?

Avoiding N+1 queries optimizes data retrieval by restructuring relational database access patterns to fetch related records in batch operations rather than individual sequential requests.

How do I use indexing strategies to fix full table scans?

Fix full table scans by adding targeted database indexes to specific columns, accelerating query speed and allowing the execution engine to locate rows without scanning entire tables.

When do I need to use limit and pagination for SQL query optimization?

Use limit and pagination for SQL query optimization when fetching large data subsets, efficiently retrieving smaller chunks sequentially to reduce memory overhead and database response times.

Does choosing appropriate data types affect database query optimization?

Choosing appropriate data types directly affects database query optimization by minimizing storage requirements and accelerating comparison operations, resulting in significantly faster query execution.

What are the limitations of using indexes for SQL performance tuning?

Index limitations in SQL performance tuning include increased write overhead and storage consumption, making indexes less suitable for heavily mutated tables where frequent updates outweigh read performance gains.