Re: Allow simplehash to use already-calculated hash values

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Allow simplehash to use already-calculated hash values
Дата
Msg-id 6a3c0f1a70ee4e8571bbc69a8f3a908ac424d7f7.camel@j-davis.com
обсуждение исходный текст
Ответ на Re: Allow simplehash to use already-calculated hash values  (Andres Freund <andres@anarazel.de>)
Список pgsql-hackers
On Wed, 2019-07-17 at 11:59 -0700, Andres Freund wrote:
> I've not tested it, but this looks reasonable to me. Do you actually
> need the lookup variant, or is that more for completeness?

Yes. If the hash table is full, I do a lookup. If not, I do an insert.

> nitpick^3: I'd s/This is intended for use/The immediate use-case is/

OK.

> > +static inline    SH_ELEMENT_TYPE *
> > +SH_INSERT_HASH_INTERNAL(SH_TYPE * tb, SH_KEY_TYPE key, uint32
> > hash, bool *found)
> 
> I'd perhaps add a comment here along the lines of:
> 
> /*
>  * This is a separate static inline function, so it can be reliably
> be inlined
>  * into its wrapper functions even if SH_SCOPE is extern.
>  */

Will do.

Regards,
    Jeff





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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Change ereport level for QueuePartitionConstraintValidation
Следующее
От: Ryan Lambert
Дата:
Сообщение: Re: FETCH FIRST clause PERCENT option