Re: Change GUC hashtable to use simplehash? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Change GUC hashtable to use simplehash?
Date
Msg-id 2334462.1700688476@sss.pgh.pa.us
Whole thread Raw
In response to Re: Change GUC hashtable to use simplehash?  (Andres Freund <andres@anarazel.de>)
Responses Re: Change GUC hashtable to use simplehash?
List pgsql-hackers
Andres Freund <andres@anarazel.de> writes:
> On 2023-11-22 15:56:21 -0500, Tom Lane wrote:
>> GUC names are just about always short, though, so I'm not sure you've
>> made your point?

> With short I meant <= 6 characters (32 / 5 = 6.x). After that you're
> overwriting bits that you previously set, without dispersing the "overwritten"
> bits throughout the hash state.

I'm less than convinced about the "overwrite" part:

+        /* Merge into hash ... not very bright, but it needn't be */
+        result = pg_rotate_left32(result, 5);
+        result ^= (uint32) ch;

Rotating a 32-bit value 5 bits at a time doesn't result in successive
characters lining up exactly, and even once they do, XOR is not
"overwrite".  I'm pretty dubious that we need something better than this.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Change GUC hashtable to use simplehash?
Next
From: Bruce Momjian
Date:
Subject: Re: [HACKERS] Changing references of password encryption to hashing