RefLib

Reference library for AI

Back

postgresql_16:9.6.27.3 The pg_buffercache_usage_counts() Function

PostgreSQL 16 > Appendixes > Additional Supplied Modules and Extensions > pg_buffercache — inspect PostgreSQL buffer cache state > The pg_buffercache_usage_counts() Function

The definitions of the columns exposed by the function are shown in (see pgbuffercache_usage_counts-columns).

| Column Type Description | | --- | | usage_count int4 A possible buffer usage count | | buffers int4 Number of buffers with the usage count | | dirty int4 Number of dirty buffers with the usage count | | pinned int4 Number of pinned buffers with the usage count |

The pg_buffercache_usage_counts() function returns a set of rows summarizing the states of all shared buffers, aggregated over the possible usage count values. Similar and more detailed information is provided by the pg_buffercache view, but pg_buffercache_usage_counts() is significantly cheaper.

Like the pg_buffercache view, pg_buffercache_usage_counts() does not acquire buffer manager locks. Therefore concurrent activity can lead to minor inaccuracies in the result.

Back