indexes
Analyze database queries and recommend missing indexes with performance impact analysis
When & Why to Use This Skill
This Claude skill automates database performance optimization by scanning codebases to identify inefficient SQL queries and recommending missing indexes. It provides a comprehensive analysis of performance impacts and generates structured implementation plans to accelerate query execution and improve overall system scalability.
Use Cases
- Slow Query Investigation: Automatically analyze backend code to identify queries causing latency and recommend specific indexes to resolve bottlenecks.
- Database Health Audits: Perform a comprehensive scan of the codebase to ensure all critical table relationships and search fields are properly indexed.
- Migration & Implementation Planning: Generate detailed documentation and migration strategies for applying performance-enhancing indexes without disrupting production.
- Performance Benchmarking: Compare query performance metrics before and after index implementation to validate efficiency gains and resource savings.
| name | indexes |
|---|---|
| description | Analyze database queries and recommend missing indexes with performance impact analysis |
Database Index Analysis
Current Time: !date
PostgreSQL: !psql --version
Scope: $ARGUMENTS (or entire codebase if not specified)
Scan whole codebase and tell me what indexes are missing.
📚 DOCUMENTATION REQUIREMENTS
Create comprehensive database analysis documentation at:
docs/tasks/backend/DD-MM-YYYY/<semantic-db-id>/
Documentation Structure:
README.md- Database analysis overview and objectivesquery-analysis.md- Detailed query performance analysisindex-recommendations.md- Missing indexes and impact analysisperformance-metrics.md- Before/after performance comparisonsimplementation-plan.md- Index creation strategy and migration planmonitoring-setup.md- Performance monitoring and alerting
Semantic Database Task ID Examples:
user-query-optimizationorder-performance-indexessearch-query-accelerationrelationship-index-analysisslow-query-investigation
Please analyze all database queries, identify missing indexes, and document recommendations according to the standards above.
$ARGUMENTS