The selective source plan repeats a 100-row inner bitmap path three times. The broad plan builds a hash from 500 customers and probes with 50000 purchases.

Joins pick a strategy from the sizes both sides bring

A join strategy connects two input streams; it is not a permanent property of the SQL text. Restricting one side to three customers can make indexed repeated lookups attractive, while joining every purchase may favor scanning once and building a hash table. PostgreSQL chooses among legal alternatives using estimated work, available access paths, ordering, and memory expectations. Table size matters, but the size after filtering matters more than a table’s name or reputation. ...

May 1, 2027 · 4 min · XB Field Notes