]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Split PGPROC 'links' field into two, for clarity
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 20 Feb 2026 20:34:42 +0000 (22:34 +0200)
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>
Fri, 20 Feb 2026 20:34:42 +0000 (22:34 +0200)
commit36bbcd5be3ffee1aa03f69228022decef6ebd37a
tree8999e0c73354bc84f55d7fbf2b02e380886112a5
parentdc592a41557b072178f1798700bf9c69cd8e4235
Split PGPROC 'links' field into two, for clarity

The field was mainly used for the position in a LOCK's wait queue, but
also as the position in a the freelist when the PGPROC entry was not
in use. The reuse saves some memory at the expense of readability,
which seems like a bad tradeoff. If we wanted to make the struct
smaller there's other things we could do, but we're actually just
discussing adding padding to the struct for performance reasons.

Reviewed-by: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Discussion: https://www.postgresql.org/message-id/3dd6f70c-b94d-4428-8e75-74a7136396be@iki.fi
src/backend/access/transam/twophase.c
src/backend/storage/lmgr/deadlock.c
src/backend/storage/lmgr/lock.c
src/backend/storage/lmgr/proc.c
src/include/storage/proc.h