pg_shmem_allocations
是一个显示服务器主共享内存段中分配情况的 系统目录 视图。
pg_shmem_allocations
添加于 PostgreSQL 13。
按PostgreSQL版本定义
pg_shmem_allocations (PostgreSQL 17)
View "pg_catalog.pg_shmem_allocations" Column | Type | Collation | Nullable | Default ----------------+--------+-----------+----------+--------- name | text | | | off | bigint | | | size | bigint | | | allocated_size | bigint | | |
pg_shmem_allocations (PostgreSQL 16)
View "pg_catalog.pg_shmem_allocations" Column | Type | Collation | Nullable | Default ----------------+--------+-----------+----------+--------- name | text | | | off | bigint | | | size | bigint | | | allocated_size | bigint | | |
pg_shmem_allocations (PostgreSQL 15)
View "pg_catalog.pg_shmem_allocations" Column | Type | Collation | Nullable | Default ----------------+--------+-----------+----------+--------- name | text | | | off | bigint | | | size | bigint | | | allocated_size | bigint | | |
pg_shmem_allocations (PostgreSQL 14)
View "pg_catalog.pg_shmem_allocations" Column | Type | Collation | Nullable | Default ----------------+--------+-----------+----------+--------- name | text | | | off | bigint | | | size | bigint | | | allocated_size | bigint | | |
pg_shmem_allocations (PostgreSQL 13)
View "pg_catalog.pg_shmem_allocations" Column | Type | Collation | Nullable | Default ----------------+--------+-----------+----------+--------- name | text | | | off | bigint | | | size | bigint | | | allocated_size | bigint | | |
更改历史记录
- PostgreSQL 15
- 可以被
pg_read_all_stats
成员访问(提交 77ea4f94)
- 可以被
- PostgreSQL 13
- 添加(提交 ed10f32e)
示例
postgres=# SELECT * FROM pg_shmem_allocations WHERE name LIKE 'Backend%' ORDER BY name; name | off | size | allocated_size ---------------------------------+-----------+--------+---------------- Backend Activity Buffer | 288185472 | 131072 | 131072 Backend Application Name Buffer | 288169088 | 8192 | 8192 Backend Client Host Name Buffer | 288177280 | 8192 | 8192 Backend SSL Status Buffer | 288316544 | 41984 | 41984 Backend Status Array | 288114816 | 54272 | 54272 (5 rows)
参考
- PostgreSQL 文档: pg_shmem_allocations