Re: Selection of join algorithm

Поиск
Список
Период
Сортировка
От Amol Bhangdiya
Тема Re: Selection of join algorithm
Дата
Msg-id CADaB4eBfBTySqGvh_4wvoDv62Eor3pZ28kZv7q8iYw7GSknW0w@mail.gmail.com
обсуждение исходный текст
Ответ на Selection of join algorithm  (Ishaya Bhatt <ishayabhatt@gmail.com>)
Список pgsql-novice
If you specify joining condition other than equality then nested loop join is invoked.
Example Query : explain analyze select name from student,takes where student.id > takes.id

If both the input to join is sorted on joining condition then merge join is invoked.
Example Query: explain analyze select stud.name from (select id, name from student order by id) stud,(select id,year from takes order by id) t where stud.id = t.id




On Sat, Mar 8, 2014 at 7:50 PM, 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?

Thanks and Regards,
Ishaya

В списке pgsql-novice по дате отправления:

Предыдущее
От: Ishaya Bhatt
Дата:
Сообщение: Selection of join algorithm
Следующее
От: Michael Rowan
Дата:
Сообщение: Trigger function