Re: [ADMIN] question on hash joins

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [ADMIN] question on hash joins
Дата
Msg-id 24789.1508429713@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [ADMIN] question on hash joins  ("Hartranft, Robert M. (GSFC-423.0)[RAYTHEON CO]"<robert.m.hartranft@nasa.gov>)
Список pgsql-admin
"Hartranft, Robert M. (GSFC-423.0)[RAYTHEON CO]" <robert.m.hartranft@nasa.gov> writes:
> Given that the hash would only contain keys and values needed for supporting
> the query I am having a hard time understanding why I am exceeding the
> 10 GB temp_file_limit.

Because *both sides* of the join are getting dumped to temp files.
This is necessary when the hash requires multiple batches.  All
but the first batch of hash keys get written out to files, and then
we reload each batch of the inner relation into the in-memory table
and scan the corresponding batch file from the outer relation.

If you can make work_mem large enough to hold the inner relation
then the problem should go away.  Note though that the per-row
overhead is significantly larger in the in-memory representation;
don't have an estimate for that offhand.
        regards, tom lane


--
Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-admin

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

Предыдущее
От: "Hartranft, Robert M. (GSFC-423.0)[RAYTHEON CO]"
Дата:
Сообщение: Re: [ADMIN] question on hash joins
Следующее
От: Chris Kim
Дата:
Сообщение: [ADMIN] WAL segement issues on both master and slave server