What problem does it solve?
This Skill addresses slow database queries and inefficient database performance by providing strategies for optimization, indexing, and query plan analysis.
Core Features & Use Cases
- Query Plan Analysis: Understand
EXPLAIN output to identify bottlenecks.
- Indexing Strategies: Learn to create effective B-Tree, Hash, GIN, GiST, BRIN, composite, partial, expression, and covering indexes.
- Query Optimization Patterns: Techniques to avoid
SELECT *, optimize WHERE clauses, improve JOIN performance, eliminate N+1 queries, and optimize pagination.
- Efficient Aggregation & Subqueries: Strategies for faster
COUNT, GROUP BY, and subquery transformations.
- Batch Operations: Optimize
INSERT and UPDATE statements.
- Advanced Techniques: Materialized views, partitioning, and understanding query hints.
- Use Case: When faced with a slow-running report that queries multiple large tables, use this Skill to analyze the
EXPLAIN plan, identify missing indexes, and refactor the query for significant performance gains.
Quick Start
Analyze the execution plan of the following SQL query: SELECT * FROM users WHERE email = 'user@example.com';