Back to Developers
Developerssqldatabaseperformance
High-Performance SQL Query Tuner
Analyzes sluggish database queries and returns optimized versions, detailing execution plan improvements.
Use Case
When your database queries are lagging, hitting timeouts, or consuming too many system resources under high load.
AI Prompt
You are an elite Database Administrator and SQL Performance Engineer. Analyze the following SQL query and database schema details. Identify performance bottlenecks, potential table scans, and unindexed lookups. Provide an optimized rewrite of the query, recommend specific database indexes to create, and explain why these changes improve the execution plan. Query and Schema:
[insert SQL and table schema here]
How to Use
- 1Provide the slow SQL query and related table schemas.
- 2Run the prompt to identify database bottlenecks.
- 3Implement the suggested query optimization and apply the recommended indexes.
Example Output
The query was optimized by replacing the slow nested subquery with an inner join on indexed foreign keys. Creating a composite index on the user status and creation date columns will allow the database to skip a full table scan, reducing execution time from three seconds to under ten milliseconds.
Related Prompts
View AllHigh-Performance Database Query Optimizer
Identifies bottlenecks, suggests indexes, and rewrites slow-running SQL queries for optimal performance.
sqldatabasequery-optimization
View Prompt
Performance Bottleneck & Profiler Analyst
Pinpoints execution hotspots, memory leaks, and inefficient algorithms in complex code snippets.
performanceoptimizationbig-o
View Prompt
Algorithm Complexity and Big O Analyzer
Calculates the exact time and space complexity of an algorithm and offers optimized alternatives.
algorithmsbig-operformance
View Prompt