Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key - Mailing list pgsql-hackers

From Jeff Davis
Subject Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key
Date
Msg-id fc4a5b83655bd80038e0a61042df32593d6e1ae3.camel@j-davis.com
Whole thread Raw
In response to Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key  (Nathan Bossart <nathandbossart@gmail.com>)
Responses Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key
Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key
List pgsql-hackers
On Mon, 2023-11-20 at 22:50 -0600, Nathan Bossart wrote:
> I'm mostly thinking out loud here, but could we just always do this? 
> I
> guess you might want to avoid it if your SH_EQUAL is particularly
> expensive
> and you know repeated lookups are rare, but maybe that's uncommon
> enough
> that we don't really care.

I like that simplehash is simple, so I'm not inclined to introduce an
always-on feature.

It would be interesting to know how often it's a good idea to turn it
on, though. I could try turning it on for various other uses of
simplehash, and see where it tends to win.

The caller can also save the hash and pass it down, but that's not
always convenient to do.

Regards,
    Jeff Davis




pgsql-hackers by date:

Previous
From: John Naylor
Date:
Subject: Re: Why is hot_standby_feedback off by default?
Next
From: Peter Eisentraut
Date:
Subject: Re: remaining sql/json patches