3 ms·
"How Postgres Executes a Tiny Join" covers a case you usually try to avoid - a join with no indices. For that it has to create temporary hash tables. If indice
by Animats 11y ago
"How Postgres Executes a Tiny Join" covers a case you usually try to avoid - a join with no indices. For that it has to create temporary hash tables. If indices are available, the usual approach is to walk one index while searching the other. Or both tables may be sorted and merged. Or an unindexed table sorted while an indexed table is walked.
The whole process is quite clever, and this is what SQL engines are really about.