pg_stat_slru — PostgreSQL statistics view

The PostgreSQL pg_stat_slru statistics view: full column reference (names, types, descriptions), catalog relationships and version support.

Summary

PostgreSQL accesses certain on-disk information via SLRU (simple least-recently-used) caches. The pg_stat_slru view will contain one row for each tracked SLRU cache, showing statistics about access to cached pages.

(Description quoted from the official PostgreSQL documentation.)

Columns

The pg_stat_slru statistics view exposes the following columns (names, types and descriptions are taken verbatim from the PostgreSQL documentation):

  • name text
    Name of the SLRU
  • blks_zeroed bigint
    Number of blocks zeroed during initializations
  • blks_hit bigint
    Number of times disk blocks were found already in the SLRU, so that a read was not necessary (this only includes hits in the SLRU, not the operating system’s file system cache)
  • blks_read bigint
    Number of disk blocks read for this SLRU
  • blks_written bigint
    Number of disk blocks written for this SLRU
  • blks_exists bigint
    Number of blocks checked for existence for this SLRU
  • flushes bigint
    Number of flushes of dirty data for this SLRU
  • truncates bigint
    Number of truncates for this SLRU
  • stats_reset timestamp with time zone
    Time at which these statistics were last reset

Version applicability

Present in PostgreSQL 17, 18, 19 (verified against each release’s documentation). This is a long-standing system object that also exists in earlier PostgreSQL releases.

Related & references

Reference: PostgreSQL documentation — pg_stat_slru.