To Enable the Global Meta Cache feature edit the postgresql.conf file and set the pgx_global_metacahe parameter. Restarting the instance after editing the postgresql.conf file is required. Refer to "Appendix A Parameters" for information on the parameters.
Parameter Name | Description |
---|---|
pgx_global_metacache | Specify the maximum amount of memory for the GMC area on shared memory. When it’s set to 0 (default value), the Global Meta Cache feature is disabled. When enabled, the minimum value allowed is 10MB. |
When the cache is created, if the total amount of meta caches on shared memory exceeds the value specified by pgx_global_metacache, the inactive, unreferenced meta caches are removed from the GMC area. Note that if all GMC are in use and the cache cannot be created in the GMC area, the cache is temporarily created in the local memory of the backend process.
Example
Here is an example postgresql.conf configuration:
pgx_global_metacache = 800 MB
The Global Meta Cache feature may cause wait events. Wait events are identified in the wait_event column of the pg_stat_activity view. GMC specific wait events are described below.
[GMC Feature Wait Events]
Wait Event Type | Wait Event Name | Description |
---|---|---|
LWLock | GlobalCatcache | Waiting to find, add, and remove meta caches in the GMC area. |
IPC | GMCSweep | Waiting to select a meta cache that can be deleted when GMC space is low. If the GMC is fully referencing and there is no deletable meta cache, it is waiting for the reference to be removed and a deletable meta cache to be selected. |
Note
If GMCSweep is happened frequently, increase the pgx_global_metacache setting.
See
Refer to "Viewing Statistics" in the PostgreSQL Documentation for information on the pg_stat_activity view.