1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-18 17:42:25 +03:00

Introduce pg_dsm_registry_allocations view.

This commit adds a new system view that provides information about
entries in the dynamic shared memory (DSM) registry.  Specifically,
it returns the name, type, and size of each entry.  Note that since
we cannot discover the size of dynamic shared memory areas (DSAs)
and hash tables backed by DSAs (dshashes) without first attaching
to them, the size column is left as NULL for those.

Bumps catversion.

Author: Florents Tselai <florents.tselai@gmail.com>
Reviewed-by: Sungwoo Chang <swchangdev@gmail.com>
Discussion: https://postgr.es/m/4D445D3E-81C5-4135-95BB-D414204A0AB4%40gmail.com
This commit is contained in:
Nathan Bossart
2025-07-09 09:17:56 -05:00
parent f5a987c0e5
commit 167ed8082f
10 changed files with 187 additions and 3 deletions

View File

@ -81,6 +81,11 @@
<entry>open cursors</entry>
</row>
<row>
<entry><link linkend="view-pg-dsm-registry-allocations"><structname>pg_dsm_registry_allocations</structname></link></entry>
<entry>shared memory allocations tracked in the DSM registry</entry>
</row>
<row>
<entry><link linkend="view-pg-file-settings"><structname>pg_file_settings</structname></link></entry>
<entry>summary of configuration file contents</entry>
@ -1086,6 +1091,75 @@ AND c1.path[c2.level] = c2.path[c2.level];
</sect1>
<sect1 id="view-pg-dsm-registry-allocations">
<title><structname>pg_dsm_registry_allocations</structname></title>
<indexterm zone="view-pg-dsm-registry-allocations">
<primary>pg_dsm_registry_allocations</primary>
</indexterm>
<para>
The <structname>pg_dsm_registry_allocations</structname> view shows shared
memory allocations tracked in the dynamic shared memory (DSM) registry.
This includes memory allocated by extensions using the mechanisms detailed
in <xref linkend="xfunc-shared-addin-after-startup" />.
</para>
<table>
<title><structname>pg_dsm_registry_allocations</structname> Columns</title>
<tgroup cols="1">
<thead>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
Column Type
</para>
<para>
Description
</para></entry>
</row>
</thead>
<tbody>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
<structfield>name</structfield> <type>text</type>
</para>
<para>
The name of the allocation in the DSM registry.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
<structfield>type</structfield> <type>text</type>
</para>
<para>
The type of allocation. Possible values are <literal>segment</literal>,
<literal>area</literal>, and <literal>hash</literal>, which correspond
to dynamic shared memory segments, areas, and hash tables, respectively.
</para></entry>
</row>
<row>
<entry role="catalog_table_entry"><para role="column_definition">
<structfield>size</structfield> <type>int8</type>
</para>
<para>
Size of the allocation in bytes. NULL for entries of type
<literal>area</literal> and <literal>hash</literal>.
</para></entry>
</row>
</tbody>
</tgroup>
</table>
<para>
By default, the <structname>pg_dsm_registry_allocations</structname> view
can be read only by superusers or roles with privileges of the
<literal>pg_read_all_stats</literal> role.
</para>
</sect1>
<sect1 id="view-pg-file-settings">
<title><structname>pg_file_settings</structname></title>