postgresql.blocks_hit
Buffer cache hitsDimensions:None
Interface Metrics (2)
Dimensions:None
Technical Annotations (21)
Configuration Parameters (3)
shared_bufferseffective_cache_sizerecommended: 50-75% of total RAMenable_seqscanrecommended: falseCLI Commands (7)
SELECT sum(blks_hit) * 100.0 / sum(blks_hit + blks_read) as buffer_hit_ratio FROM pg_stat_database;diagnosticSELECT relname, heap_blks_hit * 100.0 / nullif(heap_blks_hit + heap_blks_read, 0) as hit_ratio FROM pg_statio_user_tables WHERE heap_blks_read > 0 ORDER BY hit_ratio;diagnosticSELECT pg_reload_conf();remediationSELECT round(blks_hit*100/(blks_hit+blks_read), 2) AS cache_hit_ratio FROM pg_stat_database WHERE datname = current_database();diagnosticALTER SYSTEM SET shared_buffers = '16GB';remediationEXPLAINdiagnosticset enable_seqscan = false;remediationTechnical References (11)
shared_bufferscomponentpg_stat_databasecomponentpg_statio_user_tablescomponentOS Page CachecomponentCache Hit Ratioconceptdead tuplesconceptbuffer hitsconceptshared bufferscomponentpg_buffercachecomponentpg_prewarmcomponentcache hit ratioconceptRelated Insights (10)
Cache hit ratio below optimal causes excessive disk I/Owarning
▸
Low buffer hit ratio indicates insufficient shared_buffers or cache pressurewarning
▸
Insufficient shared_buffers causes excessive disk reads and slow querieswarning
▸
Insufficient shared_buffers limits PostgreSQL cache effectivenesswarning
▸
Cache hit ratio below 99% indicates undersized shared_buffers or high disk I/Owarning
▸
Slow queries caused by dead tuples, invalid queries, or misconfigurationwarning
▸
Insufficient shared_buffers causes excessive disk I/Owarning
▸
Sequential scans load entire table into shared buffers memory areainfo
▸
Cold buffer cache causes dramatic sequential scan performance degradationwarning
▸
Cache hit ratio below 99% indicates insufficient shared_buffers memorywarning
▸