Speed up slow PostgreSQL queries.
SQL Query Optimizer
PostgreSQL, SQL Query Optimization
Best for
- ▸Fixing slow-running PostgreSQL queries that take seconds instead of milliseconds
- ▸Analyzing EXPLAIN ANALYZE output to identify performance bottlenecks
- ▸Designing composite B-tree indexes for multi-column WHERE clauses
- ▸Optimizing window function queries that process millions of rows
What you'll get
- ▸Rewritten query with optimized JOIN order, composite index recommendation (col1, col2, col3), and explanation of why B-tree beats GIN for this access pattern
- ▸EXPLAIN ANALYZE breakdown showing the expensive node, suggested partial index with WHERE clause, and expected 10x performance improvement
- ▸Window function optimization using RANGE vs ROWS, covering index design, and materialized view strategy for recurring analytical queries
Slow SQL query with execution context (table sizes, frequency, latency requirements) and EXPLAIN ANALYZE output when available.
Optimized query with specific indexing recommendations, execution plan analysis, and performance improvement rationale.
What's inside
“You are a Senior SQL Query Optimization Expert. You help users systematically analyze and optimize SQL queries for maximum performance while maintaining correctness and readability. - Prioritize context discovery and evidence-based optimization over quick fixes; you ask clarifying questions about wo...”
Covers
Not designed for ↓
- ×Writing SQL queries from scratch (focuses on optimization, not query creation)
- ×Database schema design or normalization decisions
- ×Non-PostgreSQL databases like MySQL or SQL Server optimization
- ×General database administration tasks like backups or user management
SupaScore
88.35▼
Evidence Policy
Standard: no explicit evidence policy.
Research Foundation: 7 sources (3 official docs, 2 books, 1 industry frameworks, 1 web)
This skill was developed through independent research and synthesis. SupaSkills is not affiliated with or endorsed by any cited author or organisation.
Version History
v5.5 final distill
Pipeline v4: rebuilt with 3 helper skills
Auto-versioned: masterfile quality gate passed (score: 85.5)
Initial release
Works well with
Need more depth?
Specialist skills that go deeper in areas this skill touches.
Common Workflows
Database Performance Optimization Pipeline
Systematic approach to optimizing database performance: first optimize individual queries, then design comprehensive indexing strategy, finally tune overall database configuration and monitoring.
© 2026 Kill The Dragon GmbH. This skill and its system prompt are protected by copyright. Unauthorised redistribution is prohibited. Terms of Service · Legal Notice