PostgreSQL plan nodes

Each line of an EXPLAIN is a node: an operator that produces rows for the one above it. These are the 42 kinds of node PostgreSQL's planner uses, what each one does, and a real plan for 36 of them, from PostgreSQL 19.0.

To see the plan for your own query, use the EXPLAIN visualizer.

Scans

Seq ScanReads every page of a table, in order.
Index ScanSearches a B-tree (or other index), then fetches each matching row from the table.
Index Only ScanAnswers from the index alone, visiting the table only for pages not marked all-visible.
Bitmap Index ScanCollects the locations of matching rows from an index into a bitmap.
Bitmap Heap ScanReads the table pages a bitmap points to, in physical order.
BitmapAndIntersects bitmaps from several indexes.
BitmapOrUnites bitmaps from several indexes.
Tid ScanFetches rows by their physical address (ctid).
Tid Range ScanReads a range of physical row addresses.
Sample ScanReads a random sample of a table (TABLESAMPLE).
Subquery ScanReads the output of a subquery that could not be flattened into the outer query.
Function ScanReads the rows returned by a set-returning function.
Table Function ScanReads rows produced by XMLTABLE or JSON_TABLE.
Values ScanReads rows written out in a VALUES list.
CTE ScanReads the stored result of a WITH query.
WorkTable ScanReads the previous iteration's rows inside WITH RECURSIVE.
Named Tuplestore ScanReads a trigger's transition table.
Foreign ScanReads a foreign table through its foreign data wrapper.
Custom ScanA scan implemented by an extension.

Joins

Nested LoopFor each row of the outer input, scans the inner input.
Hash JoinBuilds a hash table from one input, then probes it with each row of the other.
HashBuilds the hash table for its parent Hash Join.
Merge JoinJoins two inputs sorted on the join key by walking them in step.
MemoizeCaches the inner side of a Nested Loop by parameter value.
MaterializeStores its input in memory so it can be read again.

Grouping and sorting

SortSorts its input.
Incremental SortFinishes sorting input that is already sorted on a prefix of the key.
AggregateComputes aggregates: count(), sum()… over all rows or per group.
GroupRemoves duplicate group keys from sorted input, without aggregates.
UniqueRemoves adjacent duplicates from sorted input.
WindowAggComputes window functions such as row_number() and sums OVER (…).
LimitStops after the first N rows (LIMIT and OFFSET).

Set operations and appends

AppendReturns the rows of each child, one child after another.
Merge AppendMerges several sorted inputs into one sorted output.
Recursive UnionRuns WITH RECURSIVE: the start query, then the recursive step until it returns nothing.
SetOpComputes INTERSECT or EXCEPT.

Modifying data

ModifyTableInserts, updates, deletes or merges the rows its child produces.
LockRowsLocks the rows it returns (SELECT … FOR UPDATE / FOR SHARE).

Other

ResultComputes a row without reading a table, or applies a one-time filter.
ProjectSetEvaluates set-returning functions in the SELECT list.
GatherCollects the rows of parallel workers.
Gather MergeCollects the sorted rows of parallel workers, keeping the order.