Re: [PATCH] Refactor *_abbrev_convert() functions

John Naylor <johncnaylorls@gmail.com>

From: John Naylor <johncnaylorls@gmail.com>
To: Aleksander Alekseev <aleksander@tigerdata.com>
Cc: PostgreSQL Development <pgsql-hackers@postgresql.org>
Date: 2026-07-02T07:27:25Z
Lists: pgsql-hackers
On Tue, Feb 24, 2026 at 9:58 PM Aleksander Alekseev
<aleksander@tigerdata.com> wrote:
> > For the first, we should probably combine in the upper half when using
> > a 64-bit hash, like this:
>
> We could do it if you insist but I'm convinced this is redundant. In a
> good hash upper 32 bits are as evenly distributed as lower ones so
> this combining doesn't buy us much.

Sure, let's keep it simple.

0001:

- h = DatumGetUInt32(hash_uint32(k->dboid));
- h ^= DatumGetUInt32(hash_any((const unsigned char *) k->channel,
- strnlen(k->channel, NAMEDATALEN)));
+ h = murmurhash32(k->dboid);
+ h ^= hash_any((const unsigned char *) k->channel,
+   strnlen(k->channel, NAMEDATALEN));

This seems like it belongs in 0002.

Also, when a hunk is changed to a single line, we should remove the
parens. I see three like this.

0002 LGTM.

--
John Naylor
Amazon Web Services