Plan operator

Memoize

Plan node introduced in PostgreSQL 14 that caches inner-side lookups during a Nested Loop join.

Memoize (PostgreSQL 14+) sits inside a Nested Loop and remembers which inner-side lookups have already been performed. When the outer side has many duplicate join keys, repeat lookups are served from the cache instead of re-executing the inner plan.

EXPLAIN ANALYZE reports cache hits and misses ("Hits: N Misses: M Evictions: K"). High hit rates make a Nested Loop competitive with a Hash Join even when the inner side is non-trivial; low hit rates mean the cache is thrashing and a different join algorithm would be faster.

If a Memoize node is misbehaving you can disable it for one session with SET enable_memoize = off to compare plans.