Re: Hash Join cost estimates

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: Hash Join cost estimates
Дата
Msg-id 20130404183622.GJ4361@tamriel.snowman.net
обсуждение исходный текст
Ответ на Re: Hash Join cost estimates  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Hash Join cost estimates  (Matthias <nitrogenycs@gmail.com>)
Список pgsql-hackers
* Tom Lane (tgl@sss.pgh.pa.us) wrote:
> > What I'm trying to get at in this overall email is: why in the world is
> > it so expensive to do hash lookups?
>
> perf or oprofile reveal anything?

Working on a test case actually- I've got one now:
http://snowman.net/~sfrost/test_case2.sql

In this example, hashing the large table is actually 2 seconds *faster*
than hashing the small table (again, all on my laptop).

> Also, I assume that the cases you are looking at are large enough that
> even the "small" table doesn't fit in a single hash batch?

No, quite the opposite, sorry for not mentioning that before.  Either
side fits completely into memory w/ a single batch.  The explain
analyze's that I posted before show that, either way, there's only one
batch involved.

> (You never did mention what work_mem setting you're testing, anyway.)

With the test case above (where I got a 2s faster run time by hashing
the big table) used a work_mem of 1GB.
Thanks!
    Stephen

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Hash Join cost estimates
Следующее
От: Dimitri Fontaine
Дата:
Сообщение: Re: Multi-pass planner