SQL Query Optimization
Optimizes PostgreSQL database performance through structured analysis, index recommendations, and advanced query refactoring patterns.
The source repository doesn't declare a license. Check its terms before reusing the code.
Key features
- Automated checklists for identifying and creating effective database indexes
- Structured workflow for benchmarking and performance analysis
- Best practices for cursor-based pagination and result caching
- In-depth guidance for interpreting PostgreSQL EXPLAIN and EXPLAIN ANALYZE plans
- Implementation patterns for resolving N+1 query and JOIN performance issues
Use cases
- Implementing efficient pagination for large-scale data tables
- Reducing high latency in production database queries
- Troubleshooting resource-heavy SQL operations during development
FAQ
What specific database issues can it resolve?
It is designed to solve common performance killers including N+1 query issues, inefficient JOIN operations, lack of proper indexing, and slow offset-based pagination.
When should I use this skill?
Use this skill whenever you encounter slow database response times, high resource usage, or when you need to refactor complex SQL logic for better scalability in a PostgreSQL environment.
What does the SQL Query Optimization skill do?
This skill provides a structured framework for Claude to analyze, benchmark, and optimize PostgreSQL queries. It uses specialized checklists and templates to identify bottlenecks and implement high-performance refactoring patterns.
Does this skill provide guidance on PostgreSQL indexes?
Yes, it includes automated checklists for identifying missing indexes and provides best practices for creating effective database indexes that minimize read latency without bloating storage.
How does this skill improve my development workflow?
It standardizes the optimization process by providing automated benchmarking templates and step-by-step guidance for interpreting EXPLAIN plans, ensuring that performance improvements are data-driven and verifiable.
Related skills
PostGIS Geospatial Development
Implements best practices for querying and managing geospatial data in PostgreSQL with PostGIS.
Database Management12 ptsSupabase Database Integration
Query and interact with Supabase databases using real-time subscriptions and PostgreSQL-compatible syntax while respecting Row Level Security policies.
Database Management12 ptsDatabase Connection Pooling
Optimizes database performance and reliability by configuring robust connection pools for SQLAlchemy across traditional and serverless architectures.
Database Management12 pts