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 Scan Reads every page of a table, in order. Index Scan Searches a B-tree (or other index), then fetches each matching row from the table. Index Only Scan Answers from the index alone, visiting the table only for pages not marked all-visible. Bitmap Index Scan Collects the locations of matching rows from an index into a bitmap. Bitmap Heap Scan Reads the table pages a bitmap points to, in physical order. BitmapAnd Intersects bitmaps from several indexes. BitmapOr Unites bitmaps from several indexes. Tid Scan Fetches rows by their physical address (ctid). Tid Range Scan Reads a range of physical row addresses. Sample Scan Reads a random sample of a table (TABLESAMPLE). Subquery Scan Reads the output of a subquery that could not be flattened into the outer query. Function Scan Reads the rows returned by a set-returning function. Table Function Scan Reads rows produced by XMLTABLE or JSON_TABLE. Values Scan Reads rows written out in a VALUES list. CTE Scan Reads the stored result of a WITH query. WorkTable Scan Reads the previous iteration's rows inside WITH RECURSIVE. Named Tuplestore Scan Reads a trigger's transition table. Foreign Scan Reads a foreign table through its foreign data wrapper. Custom Scan A scan implemented by an extension.
Joins Nested Loop For each row of the outer input, scans the inner input. Hash Join Builds a hash table from one input, then probes it with each row of the other. Hash Builds the hash table for its parent Hash Join. Merge Join Joins two inputs sorted on the join key by walking them in step. Memoize Caches the inner side of a Nested Loop by parameter value. Materialize Stores its input in memory so it can be read again.
Grouping and sorting Sort Sorts its input. Incremental Sort Finishes sorting input that is already sorted on a prefix of the key. Aggregate Computes aggregates: count(), sum()… over all rows or per group. Group Removes duplicate group keys from sorted input, without aggregates. Unique Removes adjacent duplicates from sorted input. WindowAgg Computes window functions such as row_number() and sums OVER (…). Limit Stops after the first N rows (LIMIT and OFFSET).
Set operations and appends Append Returns the rows of each child, one child after another. Merge Append Merges several sorted inputs into one sorted output. Recursive Union Runs WITH RECURSIVE: the start query, then the recursive step until it returns nothing. SetOp Computes INTERSECT or EXCEPT.
Modifying data ModifyTable Inserts, updates, deletes or merges the rows its child produces. LockRows Locks the rows it returns (SELECT … FOR UPDATE / FOR SHARE).
Other Result Computes a row without reading a table, or applies a one-time filter. ProjectSet Evaluates set-returning functions in the SELECT list. Gather Collects the rows of parallel workers. Gather Merge Collects the sorted rows of parallel workers, keeping the order.
This site is not affiliated with or endorsed by the SQLite project, the PostgreSQL Global Development Group, Oracle, Google, Meta, Cockroach Labs, Elasticsearch B.V., the Apache Software Foundation, MongoDB, Inc. or Redis Ltd. SQLite is a registered trademark of Hipp, Wyrick & Company, Inc.; PostgreSQL, MySQL, LevelDB, RocksDB, CockroachDB, Elasticsearch, Lucene, MongoDB, WiredTiger and Redis are trademarks of their owners. The names are used only to say which files the site reads.
Sister sites: LLM Anatomy · Distribution Atlas · Notation Decoder · uresk.net
Made by Spencer Uresk · About · Files you open stay on your device.