pgmeminfo

今天介绍一个非常简单的扩展 pgmeminfo,其有助于调查 Postgres 的内存使用情况。第一个函数 pgmeminfo 返回有关函数 mallinfo() 提供的内存使用情况的 glibc 信息。它比使用tophtop珍贵得多。

第二个函数 pgmeminfo_contexts 返回有关内存上下文的数据 - 这是 PostgreSQL 内部内存管理。相同的数据可以通过视图 pg_get_backend_memory_contexts 显示。函数 pgmeminfo_contexts 可以简单地累积数据,并且可以简单地限制内存上下文上的迭代深度。它比视图上的递归查询快一点(但这并不是太重要)。

postgres=# select version();
                                                 version                                                 
---------------------------------------------------------------------------------------------------------
 PostgreSQL 16.0 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 8.5.0 20210514 (Red Hat 8.5.0-21), 64-bit
(1 row)

postgres=#
postgres=# \dx
                  List of installed extensions
   Name    | Version |   Schema   |         Description          
-----------+---------+------------+------------------------------
 pgmeminfo | 1.0     | public     | show memory usage
 plpgsql   | 1.0     | pg_catalog | PL/pgSQL procedural language
(2 rows)

postgres=# \dx+ pgmeminfo 
     Objects in extension "pgmeminfo"
            Object description             
-------------------------------------------
 function pgmeminfo()
 function pgmeminfo_contexts(integer,text)
(2 rows)

postgres=#

函数的定义,如下:

postgres=# \df+ pgmeminfo
                                                                                                                                                                       List of functions
 Schema |   Name    | Result data type |                                                                                         Argument data types                                                                                         | Type | Volatility | Parallel |  Owner   | Security | Access privileges | Language | Internal name | Description 
--------+-----------+------------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+------------+----------+----------+----------+-------------------+----------+---------------+-------------
 public | pgmeminfo | record           | OUT arena bigint, OUT ordblks bigint, OUT smblks bigint, OUT hblks bigint, OUT hblkhd bigint, OUT usmblks bigint, OUT fsmblks bigint, OUT uordblks bigint, OUT fordblks bigint, OUT keepcost bigint | func | volatile   | unsafe   | postgres | invoker  |                   | c        | pgmeminfo     | 
(1 row)

postgres=# 
postgres=# \df+ pgmeminfo_contexts
                                                                                                                                                                                           List of functions
 Schema |        Name        | Result data type |                                                                                                      Argument data types                                                                                                       | Type | Volatility | Parallel |  Owner   | Security | Access privileges | Language |   Internal name    | Description 
--------+--------------------+------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+------+------------+----------+----------+----------+-------------------+----------+--------------------+-------------
 public | pgmeminfo_contexts | SETOF record     | deep integer DEFAULT 0, accum_mode text DEFAULT 'all'::text, OUT name text, OUT ident text, OUT parent text, OUT level integer, OUT total_bytes bigint, OUT total_nblocks bigint, OUT free_bytes bigint, OUT used_bytes bigint | func | volatile   | unsafe   | postgres | invoker  |                   | c        | pgmeminfo_contexts | 
(1 row)

postgres=#

函数的使用,如下:

postgres=# SELECT * FROM pgmeminfo();
  arena  | ordblks | smblks | hblks | hblkhd | usmblks | fsmblks | uordblks | fordblks | keepcost 
---------+---------+--------+-------+--------+---------+---------+----------+----------+----------
 1888256 |      20 |      0 |     3 | 929792 |       0 |       0 |  1315424 |   572832 |   134304
(1 row)

postgres=#
postgres=# select * from pgmeminfo_contexts(deep => 1, accum_mode=>'off');
           name           |          ident           |      parent      | level | total_bytes | total_nblocks | free_bytes | used_bytes 
--------------------------+--------------------------+------------------+-------+-------------+---------------+------------+------------
 TopMemoryContext         |                          |                  |     0 |       97664 |             5 |      14464 |      83200
 TopTransactionContext    |                          | TopMemoryContext |     1 |        8192 |             1 |       7752 |        440
 dynahash                 | CFuncHash                | TopMemoryContext |     1 |        8192 |             1 |        592 |       7600
 RegexpCacheMemoryContext |                          | TopMemoryContext |     1 |        1024 |             1 |        760 |        264
 dynahash                 | TableSpace cache         | TopMemoryContext |     1 |        8192 |             1 |       2128 |       6064
 dynahash                 | Type information cache   | TopMemoryContext |     1 |       24368 |             2 |       2648 |      21720
 dynahash                 | Record information cache | TopMemoryContext |     1 |        8192 |             1 |       1616 |       6576
 dynahash                 | Operator lookup cache    | TopMemoryContext |     1 |       24576 |             2 |      10792 |      13784
 RowDescriptionContext    |                          | TopMemoryContext |     1 |        8192 |             1 |       6896 |       1296
 MessageContext           |                          | TopMemoryContext |     1 |       32768 |             3 |      12192 |      20576
 dynahash                 | Operator class cache     | TopMemoryContext |     1 |        8192 |             1 |        592 |       7600
 PgStat Shared Ref Hash   |                          | TopMemoryContext |     1 |        7216 |             2 |        688 |       6528
 PgStat Shared Ref        |                          | TopMemoryContext |     1 |        8192 |             4 |       3200 |       4992
 PgStat Pending           |                          | TopMemoryContext |     1 |       16384 |             5 |      15960 |        424
 dynahash                 | smgr relation table      | TopMemoryContext |     1 |       32768 |             3 |      16880 |      15888
 TransactionAbortContext  |                          | TopMemoryContext |     1 |       32768 |             1 |      32504 |        264
 dynahash                 | Portal hash              | TopMemoryContext |     1 |        8192 |             1 |        592 |       7600
 TopPortalContext         |                          | TopMemoryContext |     1 |        8192 |             1 |       7664 |        528
 dynahash                 | Relcache by OID          | TopMemoryContext |     1 |       16384 |             2 |       3584 |      12800
 CacheMemoryContext       |                          | TopMemoryContext |     1 |     1048576 |             8 |     261600 |     786976
 WAL record construction  |                          | TopMemoryContext |     1 |       49760 |             2 |       6376 |      43384
 dynahash                 | PrivateRefCount          | TopMemoryContext |     1 |        8192 |             1 |       2648 |       5544
 MdSmgr                   |                          | TopMemoryContext |     1 |        8192 |             1 |       6776 |       1416
 dynahash                 | LOCALLOCK hash           | TopMemoryContext |     1 |       16384 |             2 |       4640 |      11744
 GUCMemoryContext         |                          | TopMemoryContext |     1 |       24576 |             2 |      12880 |      11696
 dynahash                 | Timezones                | TopMemoryContext |     1 |      104112 |             2 |       2648 |     101464
 ErrorContext             |                          | TopMemoryContext |     1 |        8192 |             1 |       7928 |        264
(27 rows)

postgres=#

## deep => 0, accum_mode=>'all' 显示累计大小
postgres=# select * from pgmeminfo_contexts();
       name       | ident | parent | level | total_bytes | total_nblocks | free_bytes | used_bytes 
------------------+-------+--------+-------+-------------+---------------+------------+------------
 TopMemoryContext |       |        |     0 |     1957552 |           240 |     566096 |    1391456
(1 row)

postgres=#

## deep => 1, accum_mode=>'all'
postgres=# SELECT * FROM pgmeminfo_contexts(deep => 1);
           name           |          ident           |      parent      | level | total_bytes | total_nblocks | free_bytes | used_bytes 
--------------------------+--------------------------+------------------+-------+-------------+---------------+------------+------------
 TopMemoryContext         |                          |                  |     0 |     1957552 |           240 |     564912 |    1392640
 TopTransactionContext    |                          | TopMemoryContext |     1 |        8192 |             1 |       7752 |        440
 dynahash                 | CFuncHash                | TopMemoryContext |     1 |        8192 |             1 |        592 |       7600
 RegexpCacheMemoryContext |                          | TopMemoryContext |     1 |       41104 |            16 |      17320 |      23784
 dynahash                 | TableSpace cache         | TopMemoryContext |     1 |        8192 |             1 |       2128 |       6064
 dynahash                 | Type information cache   | TopMemoryContext |     1 |       24368 |             2 |       2648 |      21720
 dynahash                 | Record information cache | TopMemoryContext |     1 |        8192 |             1 |       1616 |       6576
 dynahash                 | Operator lookup cache    | TopMemoryContext |     1 |       24576 |             2 |      10792 |      13784
 RowDescriptionContext    |                          | TopMemoryContext |     1 |        8192 |             1 |       6896 |       1296
 MessageContext           |                          | TopMemoryContext |     1 |       32768 |             3 |      12000 |      20768
 dynahash                 | Operator class cache     | TopMemoryContext |     1 |        8192 |             1 |        592 |       7600
 PgStat Shared Ref Hash   |                          | TopMemoryContext |     1 |        7216 |             2 |        688 |       6528
 PgStat Shared Ref        |                          | TopMemoryContext |     1 |        8192 |             4 |       3200 |       4992
 PgStat Pending           |                          | TopMemoryContext |     1 |       16384 |             5 |      15960 |        424
 dynahash                 | smgr relation table      | TopMemoryContext |     1 |       32768 |             3 |      16880 |      15888
 TransactionAbortContext  |                          | TopMemoryContext |     1 |       32768 |             1 |      32504 |        264
 dynahash                 | Portal hash              | TopMemoryContext |     1 |        8192 |             1 |        592 |       7600
 TopPortalContext         |                          | TopMemoryContext |     1 |       82992 |             9 |      45216 |      37776
 dynahash                 | Relcache by OID          | TopMemoryContext |     1 |       16384 |             2 |       3584 |      12800
 CacheMemoryContext       |                          | TopMemoryContext |     1 |     1247232 |           166 |     325440 |     921792
 WAL record construction  |                          | TopMemoryContext |     1 |       49760 |             2 |       6376 |      43384
 dynahash                 | PrivateRefCount          | TopMemoryContext |     1 |        8192 |             1 |       2648 |       5544
 MdSmgr                   |                          | TopMemoryContext |     1 |        8192 |             1 |       6776 |       1416
 dynahash                 | LOCALLOCK hash           | TopMemoryContext |     1 |       16384 |             2 |       4640 |      11744
 GUCMemoryContext         |                          | TopMemoryContext |     1 |       57344 |             5 |      25584 |      31760
 dynahash                 | Timezones                | TopMemoryContext |     1 |      104112 |             2 |       2648 |     101464
 ErrorContext             |                          | TopMemoryContext |     1 |        8192 |             1 |       7928 |        264
(27 rows)

postgres=#

## 全部显示,不累积
postgres=# SELECT * FROM pgmeminfo_contexts(deep => -1, accum_mode => 'off');
           name           |                     ident                      |          parent          | level | total_bytes | total_nblocks | free_bytes | used_bytes 
--------------------------+------------------------------------------------+--------------------------+-------+-------------+---------------+------------+------------
 TopMemoryContext         |                                                |                          |     0 |       97664 |             5 |      14464 |      83200
 TopTransactionContext    |                                                | TopMemoryContext         |     1 |        8192 |             1 |       7752 |        440
 dynahash                 | CFuncHash                                      | TopMemoryContext         |     1 |        8192 |             1 |        592 |       7600
 RegexpCacheMemoryContext |                                                | TopMemoryContext         |     1 |        1024 |             1 |        760 |        264
 RegexpMemoryContext      | ^(pgmeminfo_contexts)$                         | RegexpCacheMemoryContext |     2 |       13360 |             5 |       4928 |       8432
 RegexpMemoryContext      | ^(pgmeminfo)$                                  | RegexpCacheMemoryContext |     2 |       13360 |             5 |       5744 |       7616
 RegexpMemoryContext      | ^\\echo.*$                                     | RegexpCacheMemoryContext |     2 |       13360 |             5 |       5888 |       7472
 dynahash                 | TableSpace cache                               | TopMemoryContext         |     1 |        8192 |             1 |       2128 |       6064
 dynahash                 | Type information cache                         | TopMemoryContext         |     1 |       24368 |             2 |       2648 |      21720
 dynahash                 | Record information cache                       | TopMemoryContext         |     1 |        8192 |             1 |       1616 |       6576
 dynahash                 | Operator lookup cache                          | TopMemoryContext         |     1 |       24576 |             2 |      10792 |      13784
 RowDescriptionContext    |                                                | TopMemoryContext         |     1 |        8192 |             1 |       6896 |       1296
 MessageContext           |                                                | TopMemoryContext         |     1 |       32768 |             3 |      12192 |      20576
 dynahash                 | Operator class cache                           | TopMemoryContext         |     1 |        8192 |             1 |        592 |       7600
 PgStat Shared Ref Hash   |                                                | TopMemoryContext         |     1 |        7216 |             2 |        688 |       6528
 PgStat Shared Ref        |                                                | TopMemoryContext         |     1 |        8192 |             4 |       3200 |       4992
 PgStat Pending           |                                                | TopMemoryContext         |     1 |       16384 |             5 |      15960 |        424
 dynahash                 | smgr relation table                            | TopMemoryContext         |     1 |       32768 |             3 |      16880 |      15888
 TransactionAbortContext  |                                                | TopMemoryContext         |     1 |       32768 |             1 |      32504 |        264
 dynahash                 | Portal hash                                    | TopMemoryContext         |     1 |        8192 |             1 |        592 |       7600
 TopPortalContext         |                                                | TopMemoryContext         |     1 |        8192 |             1 |       7664 |        528
 PortalContext            | <unnamed>                                      | TopPortalContext         |     2 |        1024 |             1 |        600 |        424
 ExecutorState            |                                                | PortalContext            |     3 |       49200 |             4 |      15736 |      33464
 printtup                 |                                                | ExecutorState            |     4 |        8192 |             1 |       7928 |        264
 Table function arguments |                                                | ExecutorState            |     4 |        8192 |             1 |       7856 |        336
 ExprContext              |                                                | ExecutorState            |     4 |        8192 |             1 |       4000 |       4192
 dynahash                 | Relcache by OID                                | TopMemoryContext         |     1 |       16384 |             2 |       3584 |      12800
 CacheMemoryContext       |                                                | TopMemoryContext         |     1 |     1048576 |             8 |     261600 |     786976
 index info               | pg_class_tblspc_relfilenode_index              | CacheMemoryContext       |     2 |        2048 |             2 |        656 |       1392
 index info               | pg_toast_2619_index                            | CacheMemoryContext       |     2 |        2048 |             2 |        616 |       1432
 index info               | pg_description_o_c_o_index                     | CacheMemoryContext       |     2 |        3072 |             2 |        944 |       2128
 index info               | pg_depend_reference_index                      | CacheMemoryContext       |     2 |        3072 |             2 |        944 |       2128
 index info               | pg_depend_depender_index                       | CacheMemoryContext       |     2 |        3072 |             2 |        944 |       2128
 EventTriggerCache        |                                                | CacheMemoryContext       |     2 |        8192 |             1 |       7928 |        264
 dynahash                 | Event Trigger Cache                            | EventTriggerCache        |     3 |        8192 |             1 |       2648 |       5544
 index info               | pg_statistic_ext_relid_index                   | CacheMemoryContext       |     2 |        1024 |             1 |          0 |       1024
 index info               | pg_extension_name_index                        | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_extension_oid_index                         | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_index_indrelid_index                        | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 relation rules           | pg_available_extensions                        | CacheMemoryContext       |     2 |        8192 |             4 |       1504 |       6688
 index info               | pg_db_role_setting_databaseid_rol_index        | CacheMemoryContext       |     2 |        2048 |             2 |        584 |       1464
 index info               | pg_user_mapping_user_server_index              | CacheMemoryContext       |     2 |        2048 |             2 |        728 |       1320
 index info               | pg_user_mapping_oid_index                      | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_type_oid_index                              | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_type_typname_nsp_index                      | CacheMemoryContext       |     2 |        2048 |             2 |        544 |       1504
 index info               | pg_ts_template_oid_index                       | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_ts_template_tmplname_index                  | CacheMemoryContext       |     2 |        2048 |             2 |        760 |       1288
 index info               | pg_ts_parser_oid_index                         | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_ts_parser_prsname_index                     | CacheMemoryContext       |     2 |        2048 |             2 |        760 |       1288
 index info               | pg_ts_dict_oid_index                           | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_ts_dict_dictname_index                      | CacheMemoryContext       |     2 |        2048 |             2 |        760 |       1288
 index info               | pg_ts_config_oid_index                         | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_ts_config_cfgname_index                     | CacheMemoryContext       |     2 |        2048 |             2 |        760 |       1288
 index info               | pg_ts_config_map_index                         | CacheMemoryContext       |     2 |        3072 |             2 |       1232 |       1840
 index info               | pg_transform_type_lang_index                   | CacheMemoryContext       |     2 |        2048 |             2 |        616 |       1432
 index info               | pg_transform_oid_index                         | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_tablespace_oid_index                        | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_subscription_rel_srrelid_srsubid_index      | CacheMemoryContext       |     2 |        2048 |             2 |        728 |       1320
 index info               | pg_subscription_oid_index                      | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_subscription_subname_index                  | CacheMemoryContext       |     2 |        2048 |             2 |        760 |       1288
 index info               | pg_statistic_relid_att_inh_index               | CacheMemoryContext       |     2 |        3072 |             2 |        912 |       2160
 index info               | pg_statistic_ext_oid_index                     | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_statistic_ext_name_index                    | CacheMemoryContext       |     2 |        2048 |             2 |        760 |       1288
 index info               | pg_statistic_ext_data_stxoid_inh_index         | CacheMemoryContext       |     2 |        2048 |             2 |        728 |       1320
 index info               | pg_sequence_seqrelid_index                     | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_replication_origin_roname_index             | CacheMemoryContext       |     2 |        1024 |             1 |         40 |        984
 index info               | pg_replication_origin_roiident_index           | CacheMemoryContext       |     2 |        1024 |             1 |         40 |        984
 index info               | pg_class_relname_nsp_index                     | CacheMemoryContext       |     2 |        2048 |             2 |        544 |       1504
 index info               | pg_range_rngtypid_index                        | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_range_rngmultitypid_index                   | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_publication_rel_prrelid_prpubid_index       | CacheMemoryContext       |     2 |        2048 |             2 |        728 |       1320
 index info               | pg_publication_rel_oid_index                   | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_publication_oid_index                       | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_publication_namespace_pnnspid_pnpubid_index | CacheMemoryContext       |     2 |        2048 |             2 |        728 |       1320
 index info               | pg_publication_namespace_oid_index             | CacheMemoryContext       |     2 |        1024 |             1 |         40 |        984
 index info               | pg_publication_pubname_index                   | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_proc_oid_index                              | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_proc_proname_args_nsp_index                 | CacheMemoryContext       |     2 |        3072 |             2 |        944 |       2128
 index info               | pg_partitioned_table_partrelid_index           | CacheMemoryContext       |     2 |        1024 |             1 |         40 |        984
 index info               | pg_parameter_acl_oid_index                     | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_parameter_acl_parname_index                 | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_opfamily_oid_index                          | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_opfamily_am_name_nsp_index                  | CacheMemoryContext       |     2 |        3072 |             2 |       1232 |       1840
 index info               | pg_operator_oid_index                          | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_operator_oprname_l_r_n_index                | CacheMemoryContext       |     2 |        3072 |             2 |        808 |       2264
 index info               | pg_namespace_oid_index                         | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_namespace_nspname_index                     | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_language_oid_index                          | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_language_name_index                         | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_foreign_table_relid_index                   | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_foreign_server_oid_index                    | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_foreign_server_name_index                   | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_foreign_data_wrapper_oid_index              | CacheMemoryContext       |     2 |        1024 |             1 |         40 |        984
 index info               | pg_foreign_data_wrapper_name_index             | CacheMemoryContext       |     2 |        1024 |             1 |         40 |        984
 index info               | pg_event_trigger_oid_index                     | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_event_trigger_evtname_index                 | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_enum_typid_label_index                      | CacheMemoryContext       |     2 |        2048 |             2 |        760 |       1288
 index info               | pg_enum_oid_index                              | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_default_acl_role_nsp_obj_index              | CacheMemoryContext       |     2 |        3072 |             2 |        984 |       2088
 index info               | pg_conversion_oid_index                        | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_constraint_oid_index                        | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_conversion_name_nsp_index                   | CacheMemoryContext       |     2 |        2048 |             2 |        760 |       1288
 index info               | pg_conversion_default_index                    | CacheMemoryContext       |     2 |        3072 |             2 |       1168 |       1904
 index info               | pg_collation_oid_index                         | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_collation_name_enc_nsp_index                | CacheMemoryContext       |     2 |        3072 |             2 |        944 |       2128
 index info               | pg_opclass_am_name_nsp_index                   | CacheMemoryContext       |     2 |        3072 |             2 |       1088 |       1984
 index info               | pg_cast_source_target_index                    | CacheMemoryContext       |     2 |        2048 |             2 |        544 |       1504
 index info               | pg_auth_members_role_member_index              | CacheMemoryContext       |     2 |        3072 |             2 |       1200 |       1872
 index info               | pg_attribute_relid_attnam_index                | CacheMemoryContext       |     2 |        2048 |             2 |        760 |       1288
 index info               | pg_amop_fam_strat_index                        | CacheMemoryContext       |     2 |        3072 |             2 |        808 |       2264
 index info               | pg_amop_opr_fam_index                          | CacheMemoryContext       |     2 |        3072 |             2 |        944 |       2128
 index info               | pg_aggregate_fnoid_index                       | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_shseclabel_object_index                     | CacheMemoryContext       |     2 |        3072 |             2 |       1232 |       1840
 index info               | pg_auth_members_member_role_index              | CacheMemoryContext       |     2 |        3072 |             2 |       1200 |       1872
 index info               | pg_authid_oid_index                            | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_authid_rolname_index                        | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_database_oid_index                          | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_database_datname_index                      | CacheMemoryContext       |     2 |        1024 |             1 |         72 |        952
 index info               | pg_trigger_tgrelid_tgname_index                | CacheMemoryContext       |     2 |        2048 |             2 |        760 |       1288
 index info               | pg_rewrite_rel_rulename_index                  | CacheMemoryContext       |     2 |        2048 |             2 |        616 |       1432
 index info               | pg_amproc_fam_proc_index                       | CacheMemoryContext       |     2 |        3072 |             2 |        808 |       2264
 index info               | pg_opclass_oid_index                           | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_index_indexrelid_index                      | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 index info               | pg_attribute_relid_attnum_index                | CacheMemoryContext       |     2 |        2048 |             2 |        544 |       1504
 index info               | pg_class_oid_index                             | CacheMemoryContext       |     2 |        2048 |             2 |        912 |       1136
 WAL record construction  |                                                | TopMemoryContext         |     1 |       49760 |             2 |       6376 |      43384
 dynahash                 | PrivateRefCount                                | TopMemoryContext         |     1 |        8192 |             1 |       2648 |       5544
 MdSmgr                   |                                                | TopMemoryContext         |     1 |        8192 |             1 |       6776 |       1416
 dynahash                 | LOCALLOCK hash                                 | TopMemoryContext         |     1 |       16384 |             2 |       4640 |      11744
 GUCMemoryContext         |                                                | TopMemoryContext         |     1 |       24576 |             2 |      12880 |      11696
 dynahash                 | GUC hash table                                 | GUCMemoryContext         |     2 |       32768 |             3 |      12704 |      20064
 dynahash                 | Timezones                                      | TopMemoryContext         |     1 |      104112 |             2 |       2648 |     101464
 ErrorContext             |                                                | TopMemoryContext         |     1 |        8192 |             1 |       7928 |        264
(133 rows)

postgres=#
posted @ 2024-02-27 11:25  孤傲小二~阿沐  阅读(79)  评论(0)    收藏  举报