Re: Selection of join algorithm. - Mailing list pgsql-hackers

From Atri Sharma
Subject Re: Selection of join algorithm.
Date
Msg-id CAOeZVidUOpeyerNc3U2qDdOCiRqW_zSTVUoQfqt+ypRCHMRACw@mail.gmail.com
Whole thread Raw
In response to Selection of join algorithm.  (Ishaya Bhatt <ishayabhatt@gmail.com>)
List pgsql-hackers


On Saturday, March 8, 2014, Ishaya Bhatt <ishayabhatt@gmail.com> wrote:
Hi,

I am trying to analyze join performance. But I see that even for a table having 100,000 rows and join attribute as primary key, postgres always performs hash join.

Can anyone please tell me under which conditions merge join or nested loop join is invoked?



Nested loop is generally performed when one of the tables being joined is small so the inner loop will be fast.

Hash joins are the preferred join types unless the hash table does not fit in work_mem.if that is the case,then some other join algorithm is preferred.

Regards,

Atri 


--
Regards,
 
Atri
l'apprenant

pgsql-hackers by date:

Previous
From: Patrick Curran
Date:
Subject: Re: Static Code Analysis Exploits.
Next
From: Tom Lane
Date:
Subject: Re: Shave a few instructions from child-process startup sequence