Re: weird hash plan cost, starting with pg10

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Re: weird hash plan cost, starting with pg10
Дата
Msg-id CAMbWs4--CKO3PRrZGKbWLv-Hb3Ae-fB-rdpsva5sn6oAA3ncRQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: weird hash plan cost, starting with pg10  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers

On Mon, Apr 13, 2020 at 9:53 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
Richard Guo <guofenglinux@gmail.com> writes:
> At first I was wondering if we need to check whether HashState.hashtable
> is not NULL in ExecShutdownHash() before we decide to allocate save
> space for HashState.hinstrument. And then I convinced myself that that's
> not necessary since HashState.hinstrument and HashState.hashtable cannot
> be both NULL there.

Even if the hashtable is null at that point, creating an all-zeroes
hinstrument struct is harmless.

Correct. The only benefit we may get from checking if the hashtable is
null is to avoid an unnecessary palloc0 for hinstrument. But that case
cannot happen though.

Thanks
Richard 

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 001_rep_changes.pl stalls
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: relcache leak warnings vs. errors