pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Nathan Bossart <nathandbossart@gmail.com>
To: Sami Imseih <samimseih@gmail.com>
Cc: Bertrand Drouvot <bertranddrouvot.pg@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Improve LWLock tranche name visibility across backends
Date: Tue, 15 Jul 2025 12:12:06 -0500
Message-ID: <aHaL5uFCaj_cfueU@nathan> (raw )
In-Reply-To: <CAA5RZ0v2JdAFh9yBsgvqNXrF68SKoF+bbjhn7ZBW_Oo66XUhrQ@mail.gmail.com >
References: <aHDYHKdEyZiV/Aob@ip-10-97-1-34.eu-west-3.compute.internal >
<CAA5RZ0vK_EuHwGj8nWkb1UwYjDbqvj+ZyiYPYn3CRsU8uwKUsQ@mail.gmail.com >
<aHGJBt37dg37f1bE@nathan >
<CAA5RZ0uic7Us255mFPJSrMFH7UY-RR8YZcjBzNDzfE4gFREDGQ@mail.gmail.com >
<aHVeqtsltQyBBvAM@nathan >
<CAA5RZ0vb_CVR7SuCpHrLbV4yDQJ8o9WUudz51YRjUr4PLiDMYg@mail.gmail.com >
<aHV5BsKoSeOkIsNL@nathan >
<CAA5RZ0sjBirbsZa0su1yV2UEQFcVmy-HkeQNS+SD5oAxQaRYPQ@mail.gmail.com >
<aHaIe44bAENt8JPW@nathan >
<CAA5RZ0v2JdAFh9yBsgvqNXrF68SKoF+bbjhn7ZBW_Oo66XUhrQ@mail.gmail.com >
On Tue, Jul 15, 2025 at 12:06:00PM -0500, Sami Imseih wrote:
> On Tue, Jul 15, 2025 at 11:57 AM Nathan Bossart
> <nathandbossart@gmail.com> wrote:
>> I was imagining putting the array in one big DSA allocation instead of
>> carting around a pointer for each tranche name. (Sorry, I realize I am
>> hand-waving over some of the details.)
>
> I understood it like this. Here is a sketch:
>
> ```
> dsa_pointer p;
>
> dsa = dsa_create(....)
>
> p = dsa_allocate(dsa, LWLockTranchesInitialSize());
> tranche_names = (char **) dsa_get_address(dsa, p);
> tranche_names[0] = "my tranche";
> tranche_names[1] = "my tranche";
> ```
>
> We will need to track the size and resize if needed.
>
> Is this what you mean, from a high level?
Yes, that's roughly what I had in mind. We might need to employ some
tricks to avoid a limit on tranche name length, but maybe that's not worth
the energy.
--
nathan
view thread (107+ messages) latest in thread
Message-ID: <aHaL5uFCaj_cfueU@nathan>
Permalink: ../aHaL5uFCaj_cfueU@nathan/
Also on: postgresql.org/message-id/aHaL5uFCaj_cfueU@nathan
copy link · copy postgr.es
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-hackers@postgresql.org
Cc: nathandbossart@gmail.com, samimseih@gmail.com, bertranddrouvot.pg@gmail.com
Subject: Re: Improve LWLock tranche name visibility across backends
In-Reply-To: <aHaL5uFCaj_cfueU@nathan>
* 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