From f894acb24a12cf1f369a45af36c8f4049f9af571 Mon Sep 17 00:00:00 2001 From: Nathan Bossart Date: Tue, 2 Dec 2025 10:29:45 -0600 Subject: Show size of DSAs and dshashes in pg_dsm_registry_allocations. Presently, this view reports NULL for the size of DSAs and dshash tables because 1) the current backend might not be attached to them and 2) the registry doesn't save the pointers to the dsa_area or dshash_table in local memory. Also, the view doesn't show partially-initialized entries to avoid ambiguity, since those entries would report a NULL size as well. This commit introduces a function that looks up the size of a DSA given its handle (transiently attaching to the control segment if needed) and teaches pg_dsm_registry_allocations to use it to show the size of successfully-initialized DSA and dshash entries. Furthermore, the view now reports partially-initialized entries with a NULL size. Reviewed-by: Rahila Syed Reviewed-by: Robert Haas Reviewed-by: Chao Li Discussion: https://postgr.es/m/aSeEDeznAsHR1_YF%40nathan --- doc/src/sgml/system-views.sgml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/system-views.sgml b/doc/src/sgml/system-views.sgml index 7db8f73eba2..162c76b729a 100644 --- a/doc/src/sgml/system-views.sgml +++ b/doc/src/sgml/system-views.sgml @@ -1150,8 +1150,8 @@ AND c1.path[c2.level] = c2.path[c2.level]; size int8 - Size of the allocation in bytes. NULL for entries of type - area and hash. + Size of the allocation in bytes. NULL for entries that failed + initialization. -- cgit v1.2.3