Database Optimizer

Paste a slow PostgreSQL query and its EXPLAIN ANALYZE output. The AI returns a non-destructive migration — CREATE INDEX CONCURRENTLY or an exact query rewrite — with a matching rollback script and expected cost reduction.

Paste the exact slow-running statement from your database.

Run EXPLAIN (ANALYZE, BUFFERS) on the query. Text or JSON format both work.