pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jeff Davis <pgsql@j-davis.com>
To: John Naylor <johncnaylorls@gmail.com>
To: Andres Freund <andres@anarazel.de>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Gurjeet Singh <gurjeet@singh.im>
Cc: pgsql-hackers@postgresql.org
Subject: Re: Change GUC hashtable to use simplehash?
Date: Sun, 03 Dec 2023 13:16:20 -0800
Message-ID: <a072ac527d7c0aee551784e97e1fffba5a457f49.camel@j-davis.com> (raw)
In-Reply-To: <CANWCAZb_17xdPP7v1_mXXg5TVbWkDzkP_WDgbCWpqUvz_VZ+OQ@mail.gmail.com>
References: <c95e1821b6a69ec0c40eb0252e037b68a62cdae3.camel@j-davis.com>
	<20231117232712.mpnzsho7ydssg2oc@awork3.anarazel.de>
	<7fee9f31c2e82948fa56fe57d68eecb0cce36f10.camel@j-davis.com>
	<20231118001003.n2d7tvdgeckun2y6@awork3.anarazel.de>
	<27a7a289d5b8f42e1b1e79b1bcaeef3a40583bd2.camel@j-davis.com>
	<CANWCAZY7Cr-GdUhrCLoR4+JGLChTb0pQxq9ZPi1KTLs+_KDFqg@mail.gmail.com>
	<20231122205030.v6yllmmj6dgxpg5f@awork3.anarazel.de>
	<2330615.1700686581@sss.pgh.pa.us>
	<20231122212221.ahmlio2yfx7jla6z@awork3.anarazel.de>
	<2334462.1700688476@sss.pgh.pa.us>
	<20231122223432.lywt4yz2bn7tlp27@awork3.anarazel.de>
	<CANWCAZYDNjTh=8FxgZKmS8HEE=wcmLMoJx+Vvg3+xgAaGY=2oQ@mail.gmail.com>
	<CANWCAZb_17xdPP7v1_mXXg5TVbWkDzkP_WDgbCWpqUvz_VZ+OQ@mail.gmail.com>

On Wed, 2023-11-29 at 20:31 +0700, John Naylor wrote:
> v5-0001 puts fash-hash as-is into a new header, named in a way to
> convey in-memory use e.g. hash tables.
> 
> v5-0002 does the minimal to allow dynash to use this for string_hash,
> inlined but still calling strlen.
> 
> v5-0003 shows one way to do a incremental interface. It might be okay
> for simplehash with fixed length keys, but seems awkward for strings.
> 
> v5-0004 shows a bytewise incremental interface, with implementations
> for dynahash (getting rid of strlen) and guc hash.

I'm trying to follow the distinctions you're making between dynahash
and simplehash -- are you saying it's easier to do incremental hashing
with dynahash, and if so, why?

If I understood what Andres was saying, the exposed hash state would be
useful for writing a hash function like guc_name_hash(). But whether we
use simplehash or dynahash is a separate question, right?

Also, while the |= 0x20 is a nice trick for lowercasing, did we decide
that it's better than my approach in patch 0004 here:

https://www.postgresql.org/message-id/27a7a289d5b8f42e1b1e79b1bcaeef3a40583bd2.camel@j-davis.com

which optimizes exact hits (most GUC names are already folded) before
trying case folding?

Regards,
	Jeff Davis






view thread (103+ messages)  latest in thread

Message-ID: <a072ac527d7c0aee551784e97e1fffba5a457f49.camel@j-davis.com>
Permalink:  ../a072ac527d7c0aee551784e97e1fffba5a457f49.camel@j-davis.com/
Also on:    postgresql.org/message-id/a072ac527d7c0aee551784e97e1fffba5a457f49.camel@j-davis.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: pgsql@j-davis.com, johncnaylorls@gmail.com, andres@anarazel.de, tgl@sss.pgh.pa.us, gurjeet@singh.im
  Subject: Re: Change GUC hashtable to use simplehash?
  In-Reply-To: <a072ac527d7c0aee551784e97e1fffba5a457f49.camel@j-davis.com>
  References: <c95e1821b6a69ec0c40eb0252e037b68a62cdae3.camel@j-davis.com> <20231117232712.mpnzsho7ydssg2oc@awork3.anarazel.de> <7fee9f31c2e82948fa56fe57d68eecb0cce36f10.camel@j-davis.com> <20231118001003.n2d7tvdgeckun2y6@awork3.anarazel.de> <27a7a289d5b8f42e1b1e79b1bcaeef3a40583bd2.camel@j-davis.com> <CANWCAZY7Cr-GdUhrCLoR4+JGLChTb0pQxq9ZPi1KTLs+_KDFqg@mail.gmail.com> <20231122205030.v6yllmmj6dgxpg5f@awork3.anarazel.de> <2330615.1700686581@sss.pgh.pa.us> <20231122212221.ahmlio2yfx7jla6z@awork3.anarazel.de> <2334462.1700688476@sss.pgh.pa.us> <20231122223432.lywt4yz2bn7tlp27@awork3.anarazel.de> <CANWCAZYDNjTh=8FxgZKmS8HEE=wcmLMoJx+Vvg3+xgAaGY=2oQ@mail.gmail.com> <CANWCAZb_17xdPP7v1_mXXg5TVbWkDzkP_WDgbCWpqUvz_VZ+OQ@mail.gmail.com> <a072ac527d7c0aee551784e97e1fffba5a457f49.camel@j-davis.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox