On this page
  1. EXPLAIN
  2. Syntax & Overview
  3. Notes & Best Practices
  4. Example

EXPLAIN

Prev: `CREATE INDEX` | Up: clauses | Next: functions
Rel: clauses, SQL Query Execution Lifecycle
Ref: PostgreSQL — SQL Commands
Tags: #public #databases #sql #clauses #tier/core


Syntax & Overview

EXPLAIN (ANALYZE, BUFFERS) SELECT ...;

Displays the physical scan, index, and join plan chosen by the optimizer.

Notes & Best Practices

Example

EXPLAIN (ANALYZE, BUFFERS)
SELECT id, email FROM users WHERE email = 'ada@example.com';

Linked from

Related notes