hacking postgres hashjoin algorithm

Started by HSabout 19 years ago3 messages
#1HS
j8shen@gmail.com

Hello there

I am trying to play around with the hashjoin algorithm in postgres.

I am using the statement like
Select count(*) from r,s where r.id=s.id;

I looked at the function ExecHashJoin() in nodeHashjoin.c and cannot
find where the algorithm is comparing if r.id equals s.id

please advise.

Regards
hal

#2Martijn van Oosterhout
kleptog@svana.org
In reply to: HS (#1)
Re: hacking postgres hashjoin algorithm

On Sun, Oct 15, 2006 at 11:08:18PM -0400, HS wrote:

Hello there

I am trying to play around with the hashjoin algorithm in postgres.

I am using the statement like
Select count(*) from r,s where r.id=s.id;

I looked at the function ExecHashJoin() in nodeHashjoin.c and cannot
find where the algorithm is comparing if r.id equals s.id

The code doing the work is actually ExecScanHashBucket() which is in
nodeHash.c. The actual check is done by the ExecQual there...

Hope this helps,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/

Show quoted text

From each according to his ability. To each according to his ability to litigate.

#3HS
j8shen@gmail.com
In reply to: Martijn van Oosterhout (#2)
Re: hacking postgres hashjoin algorithm

from my understanding, postgres first needs to partition the tables.
ExecHashTableCreate() is the function that partitions the tables right?

Martijn van Oosterhout wrote:

Show quoted text

On Sun, Oct 15, 2006 at 11:08:18PM -0400, HS wrote:

Hello there

I am trying to play around with the hashjoin algorithm in postgres.

I am using the statement like
Select count(*) from r,s where r.id=s.id;

I looked at the function ExecHashJoin() in nodeHashjoin.c and cannot
find where the algorithm is comparing if r.id equals s.id

The code doing the work is actually ExecScanHashBucket() which is in
nodeHash.c. The actual check is done by the ExecQual there...

Hope this helps,