Search code examples
postgresqlinner-joinsql-execution-plan

Understanding Hash Join


enter image description here I'm not sure if I understand the picture from pgAdmin correctly.

Does this mean, that at first a hash table of persdaten is created (and stored inside hash buckets) and afterwards every row of links gets hashed and joined with the hash table of persdaten?

Is in this case persdaten the outer table and links is the inner table?


Solution

  • Your understanding is correct, except that the hashed table is called the “inner table”.

    That is mostly terminology, but it makes sense if you see it as a kind of nested loop where the hash lookup is on the inner side.