Re: Allow simplehash to use already-calculated hash values - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: Allow simplehash to use already-calculated hash values
Date
Msg-id 6a3c0f1a70ee4e8571bbc69a8f3a908ac424d7f7.camel@j-davis.com
Whole thread Raw
In response to Re: Allow simplehash to use already-calculated hash values  (Andres Freund <andres@anarazel.de>)
List 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 by date:

Previous
From: Tom Lane
Date:
Subject: Re: Change ereport level for QueuePartitionConstraintValidation
Next
From: Ryan Lambert
Date:
Subject: Re: FETCH FIRST clause PERCENT option