Re: Division in dynahash.c due to HASH_FFACTOR

Поиск
Список
Период
Сортировка
От Thomas Munro
Тема Re: Division in dynahash.c due to HASH_FFACTOR
Дата
Msg-id CA+hUKGLYYkJULnB7gs7S87_+=woSpnKzqwrnf=egWR-fW0Y94A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Division in dynahash.c due to HASH_FFACTOR  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sat, Sep 19, 2020 at 1:30 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> I wrote:
> > ISTM that getting rid of the division obviates the concern that the
> > nentries condition is too expensive,

True, that comment needed to go.

> Also, we could make it slightly cheaper yet, by changing the condition
> to
>
>             hctl->freeList[0].nentries > (long) (hctl->max_bucket)
>
> ie drop the +1.  I'd argue that this is actually a more faithful
> rendition of the previous condition, since what we had before was
> basically
>
>             hctl->freeList[0].nentries >= (long) (hctl->max_bucket + 1)

Agreed, and done.  Thanks!



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

Предыдущее
От: Michael Paquier
Дата:
Сообщение: Re: pg_logging_init() can return ENOTTY with TAP tests
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: Proposal of new PostgreSQL Extension - PGSpiderExt