pg_dsm_registry_allocations

一个显示DSM注册表中共享内存分配情况的视图
此条目涉及一项 PostgreSQL 功能,该功能是 PostgreSQL 19 的一部分,预计将于 2026 年底发布。

pg_dsm_registry_allocations 是一个 系统目录 视图,显示了在动态共享内存 (DSM) 注册表中跟踪的共享内存分配情况。

pg_dsm_registry_allocationsPostgreSQL 19 中被添加。

按 PostgreSQL 版本定义

pg_dsm_registry_allocations (PostgreSQL 19)

  View "pg_catalog.pg_dsm_registry_allocations"
 Column |  Type  | Collation | Nullable | Default 
--------+--------+-----------+----------+---------
 name   | text   |           |          | 
 type   | text   |           |          | 
 size   | bigint |           |          |
    

文档: pg_dsm_registry_allocations

变更历史

示例

在刚启动的服务器上使用 pg_dsm_registry_allocations 的基本用法示例

postgres=# SELECT * FROM pg_dsm_registry_allocations;
 name | type | size 
------+------+------
(0 rows)

使用 src/test/modules/test_dsm_registry/ 中的测试扩展来注册一些共享内存分配

postgres=# CREATE EXTENSION test_dsm_registry;
CREATE EXTENSION

postgres=# SELECT set_val_in_shmem(1236);
 set_val_in_shmem 
------------------
 
(1 row)

postgres=# SELECT set_val_in_hash('test', '1414');
 set_val_in_hash 
-----------------
 
(1 row)

postgres=# SELECT * FROM pg_dsm_registry_allocations;
          name          |  type   | size 
------------------------+---------+------
 test_dsm_registry_dsa  | area    |     
 test_dsm_registry_hash | hash    |     
 test_dsm_registry_dsm  | segment |   20
(3 rows)

分类

内存, 系统目录

另请参阅

pg_shmem_allocations, pg_shmem_allocations_numa

反馈

在此 提交关于“pg_dsm_registry_allocations”的任何评论、建议或更正