Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vn4tq-0027Rp-2w for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Feb 2026 01:08:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vn4tp-002OHS-2u for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Feb 2026 01:08:13 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1vn4tp-002OHJ-1t for pgsql-hackers@lists.postgresql.org; Tue, 03 Feb 2026 01:08:13 +0000 Received: from mail-qk1-x743.google.com ([2607:f8b0:4864:20::743]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vn4tn-00000000Gvl-38wC for pgsql-hackers@postgresql.org; Tue, 03 Feb 2026 01:08:12 +0000 Received: by mail-qk1-x743.google.com with SMTP id af79cd13be357-8c5384ee23fso571763385a.1 for ; Mon, 02 Feb 2026 17:08:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1770080891; cv=none; d=google.com; s=arc-20240605; b=NQQZEE3fHbE7kHRg2OJkGc+JM+9IXff6c+k8WJYxcYToVVS2+QReAL7DDuX5p/IXlI YDz+goEdd7bDEL5i7t5d5cT64tKuynwO38FSCpy4foKKEsCfPBVWqokunEuLIhSlQpEZ 7e+auMkF6urGNL7OztG7EmJBlJHfgCNd1SjSlDdQ+U6kwPFelpZwnC5N6aAqaKeKSBfT G2LKDdoDMzC37vyyjfpmFT2lctobnYR4uml6EPutbomhTJbNGgeCed1boNa4lm2BlG0w tS3bn7NU73XqfIw3kirDmYCIM9xkRab6a6D8W6Tbs7v+8r9UVsb2Gna2V8JDwklZQTt0 9Iig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=l+Y48m7PJWcmKjFNx33sqlDjk6/+B7A7TABQcMyFfwA=; fh=q4zplcgEPnUZ6BQVnKTG1XqOMRY2cGcfndKkxPQ+j4o=; b=OFUN1LOsXLsVrRluHh8iMUInNcjZVvGgdl+2yTFZG4oDH9LLopbniCCoCHlIEcOv98 CiWT2LvvAfPrFlKr/kWpVHN6Rx6/1UhIEw7WSXw/lBoxkmBuRGVUNF/VV6PcwMDJ1dmC ML5rQf/Iq62+xrSG07Stuabb/wsc/kOddEmIHSyDSichj/nx2LpfRmDrUk2hXjh1EhEe KceTwbd6ADpugha6oP/6FjeELlevOsIVpqf/DPN2PNXUp1dTsnCFPnjNRknrlDR5t8Ay vWwgrLs0AlIxGsFN/GbXXx8+ZpnRxuGyRHAhHWT5LWxtD0q7dvkznwwv8S7C1c/uobx0 ks8g==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770080891; x=1770685691; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=l+Y48m7PJWcmKjFNx33sqlDjk6/+B7A7TABQcMyFfwA=; b=B32wSPOc+9dEt+foLJc9/D07abqdA6seRO6sgrFMHsqLBLBI7t5O9oq+LCZ7imqjRW ClcgMPh9osdgrV4dSrhegmaJ6dda0tMNZHTwQwlZexWFA9wU7wplaN6ajbJzmkepFz8d ZtOW38VXglxuHgUVjYW9VEl0WJs642J2Wn289xb3/k3eLNOHcdsveEDVnJ6RQNuTGk5f HHfISUTazw1T/DEuj/WWqqTOt1qRWisd2PLJoQsuuvoFvot43zwYhLKT1fQH4dqAgMyd BMdDYMdmStu7D5QL4Td6567Y3eGmjjlOVhCLy0ZbLnlfchpcx8hfSSQOeTx3CnvFvOuN ff1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770080891; x=1770685691; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=l+Y48m7PJWcmKjFNx33sqlDjk6/+B7A7TABQcMyFfwA=; b=HGPNJHqh47EMyrvhiEdjCrGR1rnue2b4CyWtEa5bdjZ5PxVkdne5p6BHN+BBUNT3j7 42eQXZ0UwsPUR4lJby1piw2PYRwFpyOx18A0jNNNe+5NzQvMBJWqxzK4/u7YP6ebOlPb aQH84bJSXg4GwubQ+ZLApxTTK/90P3va7Rebl5d/xzpzrcXAAb41zxHvlcZJ31KV94l4 tRtSOg6IHhzy7TAW+qcuPXSMvLkUNmQt8tz0qImhZ9a+kX1lRm6cjPMh9Agwd/aIe7+1 IgxMgbBtVeaP2TrxGTCFbGJBgR3jUKLv4KusUqcaiGFMEjBrbuUAegxC36tTSeTAsB7A 9c3Q== X-Gm-Message-State: AOJu0YwFeG8ZzjIpDan5wLnu6JplspJxLFTpJU5nzUgNn6nBSfXJBUoQ xJxF00fTnuj2c7k5ZmgjsSB28x9KPvVAWKAE82Lm6hj4oHmL6uem5Ht0SIg2vOHfj9rdcWd9TnC 3RO1Mv+MZLAKqfY7tnbkv2Uno+RTqIZY= X-Gm-Gg: AZuq6aI18zNExj1pDUfjUI3FS01BWUfUf4zvORCRnaR5P/wJCoHV55iSa9sbkOUQ5xz wHGSouVugj6zsiMBI0GsuQJPLytkkktwcaw/NXb0+7lz2TiKlSgQrtbCFGU3UvGkmnETR+5K733 icOjSf0gzd4fwRDOKsjgDP1H1OLc41JW6y99iAFX9sxWCcHnl0QketbSrn/2M5mvF6F91RsUcIT 8tuRVYfdr3lrIRs+GEZZOqAelNxVGPKiFiNhLRcscNcEygNvAR1j2Je7+s5Qf7PuylPrwTuvL7w qjrA02DjmcqTNtxFVgUbidfA+4G0FMIoDQ8BIF5+ER4tFOmjl8F8q1LAWug7qSvUr1jTnxFW7Nb o7o5wcmWKOdKZGrunuwkbvUOo1w== X-Received: by 2002:a05:622a:1aa4:b0:4ee:1563:2837 with SMTP id d75a77b69052e-505d22b37edmr171315681cf.67.1770080890618; Mon, 02 Feb 2026 17:08:10 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: John Naylor Date: Tue, 3 Feb 2026 08:07:59 +0700 X-Gm-Features: AZwV_QhtwZzgfzYLmZId_M_oNnDQsfkIgpnzKqVQBITm_OU7eBnrFuDkL0J-1T8 Message-ID: Subject: Re: [PATCH] Refactor *_abbrev_convert() functions To: Aleksander Alekseev Cc: PostgreSQL Development Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jan 13, 2026 at 7:34=E2=80=AFPM Aleksander Alekseev wrote: > Now when all Datums are 64-bit values we can simplify the code by > using murmurhash64(). This refactoring was previously suggested by > John Naylor [1]. There's more we can do here. Above the stanzas changed in the patch there is this, at least for varlena/bytea: hash =3D DatumGetUInt32(hash_any((unsigned char *) authoritative_data, Min(len, PG_CACHE_LINE_SIZE))); This makes no sense to me: hash_any() calls hash_bytes() and turns the result into a Datum, and then we just get it right back out of the Datum again. addHyperLogLog says "typically generated using hash_any()", but that function takes a uint32, not a Datum, so that comment should probably be changed. hash_bytes() is global, so we can use it directly. if (len > PG_CACHE_LINE_SIZE) hash ^=3D DatumGetUInt32(hash_uint32((uint32) len)); Similar here, but instead of hash_bytes_uint32(), we may as well use mumurhash32(). --=20 John Naylor Amazon Web Services