Optimize database query performance
Analyse a slow query's execution plan to find missing indexes, bad joins, and N+1 patterns. Provides the optimised query and exact index creation commands.
Preview
Copy prompt
The following database query is running too slowly: [Paste the query]. It takes [X ms] to execute on a table with [N] rows. Please also share the EXPLAIN ANALYZE output if available. Analyse the execution plan to identify missing indexes, full table scans, expensive sort operations, inefficient join order, and N+1 query patterns. Provide a fully optimised rewrite of the query and the exact CREATE INDEX commands needed to support it. Explain the performance impact of each individual change.
More
Performance
Prompts
