pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix dynahash's HASH_FIXED_SIZE ("isfixed") option.
Date: Fri, 25 Jul 2025 14:57:04 +0000
Message-ID: <E1ufJr6-000gqE-1i@gemulon.postgresql.org> (raw)

Fix dynahash's HASH_FIXED_SIZE ("isfixed") option.

This flag was effectively a no-op in EXEC_BACKEND (ie, Windows)
builds, because it was kept in the process-local HTAB struct,
and it could only ever become set in the postmaster's copy.

The simplest fix is to move it to the shared HASHHDR struct.
We could keep a copy in HTAB as well, as we do with keysize
and some other fields, but the "too much contention" argument
doesn't seem to apply here: we only examine isfixed during
element_alloc(), which had better not get hit very often for
a shared hashtable.

This oversight dates to 7c797e719 which invented the option.
But back-patching doesn't seem appropriate given the lack of
field complaints.  If there is anyone running an affected
workload on Windows, they might be unhappy about the behavior
changing in a minor release.

Author: Aidar Imamov <a.imamov@postgrespro.ru>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/4d0cb35ff01c5c74d2b9a582ecb73823@postgrespro.ru

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/5457ea46d181f8b8dbe1ae482720b23bff4029de

Modified Files
--------------
src/backend/utils/hash/dynahash.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)



Message-ID: <E1ufJr6-000gqE-1i@gemulon.postgresql.org>
Permalink:  ../E1ufJr6-000gqE-1i@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1ufJr6-000gqE-1i@gemulon.postgresql.org

 · 

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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Fix dynahash's HASH_FIXED_SIZE ("isfixed") option.
  In-Reply-To: <E1ufJr6-000gqE-1i@gemulon.postgresql.org>

* 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