Re: Join of small table with large table

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Join of small table with large table
Дата
Msg-id 29396.1021301325@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Join of small table with large table  (large scale <largescale_1999@yahoo.com>)
Список pgsql-hackers
large scale <largescale_1999@yahoo.com> writes:
> Aggregate  (cost=353859488.21..353859488.21 rows=1
> width=78)
>   ->  Merge Join  (cost=1714676.02..351297983.38
> rows=1024601931 width=78)
>         ->  Index Scan using genescript_genomseqid on
> genescript  (cost=0.00..750.35 rows=25115 width=62)
>         ->  Sort  (cost=1714676.02..1714676.02
> rows=6801733 width=16)
>               ->  Seq Scan on mouseblathuman 
> (cost=0.00..153685.33 rows=6801733 width=16)

That plan seems odd to me too.  Have you done VACUUM ANALYZE on these
tables?

I would think that a hash join would be preferable.  You might need to
increase the SORT_MEM parameter to let the whole smaller table be
stuffed into memory before the planner will think so, though.
Try setting it to 10000 or so (ie, 10 MB).
        regards, tom lane


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

Предыдущее
От: "Rod Taylor"
Дата:
Сообщение: Re: Join of small table with large table
Следующее
От: "Rod Taylor"
Дата:
Сообщение: Re: strange explain