simplehash: tb->sizemask = 0

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема simplehash: tb->sizemask = 0
Дата
Msg-id ad325190-4957-200b-7f1c-f2b936bfe74d@2ndquadrant.com
обсуждение исходный текст
Ответы Re: simplehash: tb->sizemask = 0
Список pgsql-hackers
Hi,

I'm a bit puzzled by this code in SH_COMPUTE_PARAMETERS:
   if (tb->size == SH_MAX_SIZE)       tb->sizemask = 0;   else       tb->sizemask = tb->size - 1;

Doesn't that mean that with SH_MAX_SIZE we end up with sizemask being 0
(i.e. no bits set)? At least that's what I get from
   printf("%#x\n", (unsigned int)0);

That would mean SH_INITIAL_BUCKET/SH_NEXT/SH_PREV can only ever return
bucket 0, no?

I don't think we're building hash tables with 2^32 buckets, though.


regards

-- 
Tomas Vondra                  http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


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

Предыдущее
От: Peter Geoghegan
Дата:
Сообщение: Re: [HACKERS] Challenges preventing us moving to 64 bit transactionid (XID)?
Следующее
От: Robert Haas
Дата:
Сообщение: Re: default range partition and constraint exclusion