show size of DSAs and dshash tables in pg_dsm_registry_allocations - Mailing list pgsql-hackers

From Nathan Bossart
Subject show size of DSAs and dshash tables in pg_dsm_registry_allocations
Date
Msg-id aSeEDeznAsHR1_YF@nathan
Whole thread Raw
Responses Re: show size of DSAs and dshash tables in pg_dsm_registry_allocations
List pgsql-hackers
On Tue, Nov 25, 2025 at 07:13:03PM -0500, Robert Haas wrote:
> In my ideal world, it would probably show partially-initialized entires
> in some distinguishable way, like with a null size.

I reevaluated this view, and I think we can do what you suggest here.
Right now, we show NULL for DSAs and dshash tables because 1) we might not
be attached to them and 2) we don't have a pointer to the dsa_area * or
dshash_table * in local memory.  If we introduce a function that looks up
the size of a DSA given its handle (transiently attaching to the control
segment if needed), we can show the size for all successfully-initialized
entries.  Then, we can make NULL mean that the entry was
partially-initialized.

Patch attached.

-- 
nathan

Attachment

pgsql-hackers by date:

Previous
From: Peter Smith
Date:
Subject: Re: CREATE/ALTER PUBLICATION improvements for syntax synopsis
Next
From: David Rowley
Date:
Subject: Re: Some optimizations for COALESCE expressions during constant folding