此条目涉及一项 PostgreSQL 功能,该功能是 PostgreSQL 19 的一部分,预计将于 2026 年底发布。
pg_dsm_registry_allocations 是一个 系统目录 视图,显示了在动态共享内存 (DSM) 注册表中跟踪的共享内存分配情况。
pg_dsm_registry_allocations 在 PostgreSQL 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 | | |
变更历史
- PostgreSQL 19
- 已添加(提交 167ed808)
示例
在刚启动的服务器上使用 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)
参考资料
- PostgreSQL 19 文档: pg_dsm_registry_allocations
