Re: HashJoin order, hash the large or small table? Postgres likes to hash the big one, why?
Re: HashJoin order, hash the large or small table? Postgres likes to hash the big one, why?
От:
pasman pasmański <pasman.p@gmail.com>
Дата:
hi. >I think you're missing the point, which is that all the hash work is >just pure overhead in such a case (and it is most definitely not >zero-cost overhead). You might as well just do a nestloop join. >Hashing is only beneficial to the extent that it allows a smaller subset >of the inner relation to be compared to each outer-relation tuple. >So I think biasing against skew-distributed inner relations is entirely >appropriate. Scanning smaller relation first is better with cursors. First rows from query are returned faster in this case. Maybe add this optimization for cursors only? ------------ pasman