Create Optimized Database Indexes
Generate efficient database indexes with AI. Optimize query performance, reduce response time, and improve database efficiency instantly.
Prompt Template
Variables to Customize
[DATABASE_TYPE] The database management system being used
Example: PostgreSQL
[TABLE_STRUCTURE] Description of table schemas, columns, and data types
Example: Users table: id (primary key), email (varchar), created_at (timestamp), status (enum), department_id (foreign key)
[COMMON_QUERIES] Frequently executed queries that need optimization
Example: SELECT * FROM users WHERE email = ? AND status = 'active'; SELECT COUNT(*) FROM users WHERE created_at > ? GROUP BY department_id
[PERFORMANCE_ISSUES] Current performance problems being experienced
Example: Login queries taking 2-3 seconds, user search by email timing out, dashboard reports running slowly
[DATA_VOLUME] Current and expected data size
Example: 500K users currently, growing by 10K monthly
[READ_WRITE_RATIO] Proportion of read vs write operations
Example: 80% reads, 20% writes
Example Output
Pro Tips for Best Results
- Always test indexes on a staging environment with realistic data volumes before production deployment
- Use EXPLAIN ANALYZE to measure actual performance improvements, not just execution plans
- Consider partial indexes for queries with frequent WHERE conditions to reduce storage overhead
- Monitor index usage statistics regularly to identify unused indexes that should be dropped
- Implement indexes during low-traffic periods and use CONCURRENTLY option when available
Tags
Want 500+ Expert Prompts?
Get the Premium Prompt Pack — organized, tested, and ready to use.
Get it for $29Related Prompts You Might Like
Generate Environment Configuration Files
You are an expert DevOps engineer tasked with creating environment configuration files. Generate comprehensive configura...
Convert JavaScript to TypeScript
You are an expert TypeScript developer tasked with converting JavaScript code to TypeScript. Please convert the followin...
Create Comprehensive Database Backup Strategy
You are a senior database administrator with expertise in enterprise backup strategies and disaster recovery planning. C...
Fix Memory Leak in Application
I need help debugging a memory leak in my [PROGRAMMING_LANGUAGE] application. Here are the details: **Application Conte...
Optimize Database Query Performance
You are a senior database performance engineer with expertise in query optimization. I need you to analyze and optimize ...
Debug Async JavaScript Issues
You are an expert JavaScript debugger specializing in asynchronous code issues. I need help debugging async JavaScript p...