Re: Division in dynahash.c due to HASH_FFACTOR

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Division in dynahash.c due to HASH_FFACTOR
Дата
Msg-id 596167.1600477906@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Division in dynahash.c due to HASH_FFACTOR  (Thomas Munro <thomas.munro@gmail.com>)
Ответы Re: Division in dynahash.c due to HASH_FFACTOR
Список pgsql-hackers
Thomas Munro <thomas.munro@gmail.com> writes:
> Pushed.  Thanks Jakub, everyone.

BTW, looking over this patch, I wonder about

        /*
         * Can't split if running in partitioned mode, nor if frozen, nor if
         * table is the subject of any active hash_seq_search scans.  Strange
         * order of these tests is to try to check cheaper conditions first.
         */
        if (!IS_PARTITIONED(hctl) && !hashp->frozen &&
            hctl->freeList[0].nentries > (long) (hctl->max_bucket + 1) &&
            !has_seq_scans(hashp))
            (void) expand_table(hashp);

ISTM that getting rid of the division obviates the concern that the
nentries condition is too expensive, and therefore we should revert
to checking it first, on the grounds that that condition is most
likely to fail.

            regards, tom lane



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: fixing old_snapshot_threshold's time->xid mapping
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Division in dynahash.c due to HASH_FFACTOR