Re: [ADMIN] question on hash joins

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [ADMIN] question on hash joins
Дата
Msg-id 30523.1508422449@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [ADMIN] question on hash joins  ("Hartranft, Robert M. (GSFC-423.0)[RAYTHEON CO]"<robert.m.hartranft@nasa.gov>)
Ответы Re: [ADMIN] question on hash joins
Список pgsql-admin
"Hartranft, Robert M. (GSFC-423.0)[RAYTHEON CO]" <robert.m.hartranft@nasa.gov> writes:
> Sorry if I am being dense, but I still have a question…
> Is it possible for me to estimate the size of the hash and a value for
> the temp_file_limit setting using information in the explain plan?

Well, it'd be (row_overhead + data_width) * number_of_rows.

Poking around in the source code, it looks like the row_overhead in
a tuplestore temp file is 10 bytes (can be more if you have nulls in
the data).  Your example seemed to be storing one bigint column,
so data_width is 8 bytes.  data_width can be a fairly squishy thing
to estimate if the data being passed through the join involves variable-
width columns, but the planner's number is usually an OK place to start.

> For example, one possibility is that the hash contains the entire tuple for each
> matching row.

No, it's just the columns that need to be used in or passed through the
join.  If you want to be clear about this you can use EXPLAIN VERBOSE
and check what columns are emitted by the plan node just below the hash.
        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
Следующее
От: "Hartranft, Robert M. (GSFC-423.0)[RAYTHEON CO]"
Дата:
Сообщение: Re: [ADMIN] question on hash joins