EXPLAIN in ParadeDB reveals the execution plan PostgreSQL will use to run your query, helping you diagnose and optimize performance.
Inspection shows how ParadeDB scans tables, uses indexes, joins data, and estimates costs, letting you remove bottlenecks before they hurt users.
Prepend EXPLAIN
or EXPLAIN ANALYZE
to any SELECT, INSERT, UPDATE, or DELETE. The first shows estimates; the second runs the query and adds actual timing and row counts.
Add FORMAT
to target TEXT
(default), JSON
, YAML
, or XML
. JSON is easiest to parse in CI pipelines.
Start at the deepest node; ParadeDB executes children first. Check cost, rows, and width. Large gaps between estimated and actual rows signal stale statistics.
Use it only on read-only replicas or when write impact is acceptable. It runs the query, so UPDATEs and DELETEs will modify data unless you wrap them in a rollback-bound transaction.
Create indexes on filter columns, avoid SELECT *, and ensure appropriate JOIN order. Use ANALYZE
to refresh statistics after bulk loads.
Save JSON plans in a version-controlled folder so you can compare changes over commits and catch regressions early.
No. EXPLAIN itself is read-only and takes only AccessShare locks. EXPLAIN ANALYZE uses the same locks as the underlying query.
Use EXPLAIN (FORMAT JSON)
and load the output into tools like Dalibo's Visualizer.