Andres Freund <and...@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


Reply via email to