Skip to content
masterclass Buddy

PostgreSQL · Command

EXPLAIN

EXPLAIN shows PostgreSQL's chosen execution plan for a statement. It can report estimated costs and, with ANALYZE, actual execution statistics.

Last updated

Syntax

EXPLAIN [ ( option [, ...] ) ] statement
EXPLAIN [ ANALYZE ] [ VERBOSE ] statement

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • ANALYZE
  • EXECUTE
  • PREPARE
  • ANALYZE

Source: PostgreSQL: Documentation: 16: EXPLAIN. Checked 2026-11-03.