sql-optimization-patterns

Identify and resolve inefficient SQL patterns causing slow queries in PostgreSQL and MySQL.

Updated Apr 14, 2026
One-click install
npx skills add https://github.com/JuanDiego30/cermont_aplicativo --skill sql-optimization-patterns-juandiego30
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-optimization-patterns
Source: https://github.com/JuanDiego30/cermont_aplicativo/tree/main/.agents/skills/sql-optimization-patterns
Command: npx skills add https://github.com/JuanDiego30/cermont_aplicativo --skill sql-optimization-patterns-juandiego30

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

SQL performance can degrade due to poorly designed queries, missing or misused indexes, and unoptimized query plans; this Skill provides structured patterns to systematically analyze and optimize queries to reduce latency and database load.

Core Features & Use Cases

  • Pattern-driven optimization: Apply proven techniques for indexing, query rewriting, and plan analysis to improve throughput.
  • Indexing strategy guidance: Design and implement appropriate indexes (including composite and partial indexes) to accelerate common queries.
  • Explain plan mastery: Use EXPLAIN and EXPLAIN ANALYZE to identify bottlenecks and validate improvements across PostgreSQL and MySQL.

Quick Start

Analyze the slow query with EXPLAIN, apply a recommended index strategy, and re-check performance.

Frequently Asked Questions about sql-optimization-patterns

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

FAQPage Schema
How do I optimize slow SQL queries using EXPLAIN plan analysis?

Resolve inefficient SQL patterns by applying proven indexing strategies and query rewriting techniques to systematically reduce database latency and load.

What is the best way to design indexes for PostgreSQL and MySQL performance?

Design PostgreSQL and MySQL indexes by implementing composite and partial index strategies tailored to common queries, reducing full table scans and improving throughput.

How do I fix N+1 query problems in database-backed applications?

Fix N+1 query problems by identifying inefficient query construction patterns and applying scalable optimization techniques to reduce redundant database calls and lower system load.

Does this SQL optimization approach work with both PostgreSQL and MySQL environments?

Yes, this SQL optimization approach applies to database-backed applications across PostgreSQL and MySQL environments, covering query tuning, indexing strategies, and EXPLAIN plan analysis.