sql-optimization-patterns

Analyze and optimize SQL queries using indexing and EXPLAIN plan analysis.

Updated Aug 23, 2026
One-click install
npx skills add https://github.com/The-Entourage-AI-Development/trade-certify --skill sql-optimization-patterns-the-entourage-ai-development
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: sql-optimization-patterns
Source: https://github.com/The-Entourage-AI-Development/trade-certify/tree/main/.claude/skills/sql-optimization-patterns
Command: npx skills add https://github.com/The-Entourage-AI-Development/trade-certify --skill sql-optimization-patterns-the-entourage-ai-development

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve?

This Skill helps teams dramatically improve database performance by systematically diagnosing slow queries and applying proven indexing, EXPLAIN plan analysis, and query refactoring techniques.

Core Features & Use Cases

  • Analyze query plans to identify bottlenecks
  • Design effective indexing strategies for common workloads
  • Refactor queries to reduce N+1 problems and improve join performance
  • Use case: optimize a reporting dashboard with large aggregates to meet SLA

Quick Start

Identify a slow query and apply the included optimization patterns to dramatically improve 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?

You optimize slow SQL queries by analyzing EXPLAIN plans to identify bottlenecks, then applying indexing strategies and pattern-based refactoring to reduce execution time and improve database performance.

What's the best way to fix N+1 query problems and improve join performance?

Fixing N+1 problems requires query refactoring to consolidate redundant database calls and optimize join performance, utilizing proven optimization patterns for scalable database workloads.

Can I use this approach to optimize reporting dashboards with large aggregates in PostgreSQL?

Yes, this approach applies indexing and EXPLAIN plan analysis to optimize reporting dashboards with large aggregates across PostgreSQL and MySQL environments to meet performance SLAs.

How do I design effective indexing strategies for common database workloads?

Designing effective indexing strategies requires analyzing query plans and applying safe, reusable optimization templates to support common database workloads and scalable schemas.

What are the limitations of pattern-based SQL query refactoring for database tuning?

Pattern-based SQL refactoring requires interpreting accurate query plans and relies on systematic diagnosis of slow queries; without proper EXPLAIN analysis, applying generic optimization templates may not resolve complex schema bottlenecks.