Re: HashJoin order, hash the large or small table? Postgres likes to hash the big one, why?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux