↵ Back to EXPLAIN documentation
Nested Loop
Nested Loop is a simple join algorithm. The first child node is run once, then for each row it produces matching rows are looked up in the second child node.
For example, the child nodes might be a Seq Scan on a tiny table and an Index Only Scan on a larger table. In this case, the Seq Scan would run once, and each row it produced would cause a loop of the Index Only Scan.
The Nested Loop algorithm is cheap to start, but gets more expensive as the number of loops increases. As such, it is often chosen when Postgres estimates that one of the relations is small. If it is chosen in spite of this, then it might be the only option available (due to the join condition).
Nested Loop fields
Related operations
Related official docs
Further reading
For more help deciphering query plans, check out our product pgMustard.
Last updated: December 2024, PostgreSQL 17
Issue reports and suggestions are welcome, please get in touch.