Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key
Дата
Msg-id 20231121165138.eoag2db3phqenzj5@awork3.anarazel.de
обсуждение исходный текст
Ответ на Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key  (Jeff Davis <pgsql@j-davis.com>)
Ответы Re: simplehash: SH_OPTIMIZE_REPEAT for optimizing repeated lookups of the same key  (Jeff Davis <pgsql@j-davis.com>)
Список pgsql-hackers
Hi,

On 2023-11-20 22:37:47 -0800, Jeff Davis wrote:
> 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.

I think it'd be a bad idea to make it always on - there's plenty cases where
it just would make things slower because the hit rate is low. A equal
comparison is far from free.

I am not quite sure this kind of cache best lives in simplehash - ISTM that
quite often it'd be more beneficial to have a cache that you can test more
cheaply higher up.

Greetings,

Andres Freund



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Locks on unlogged tables are locked?!
Следующее
От: Jeff Davis
Дата:
Сообщение: Re: Change GUC hashtable to use simplehash?