Cold buffer cache causes dramatic sequential scan performance degradation
warningperformanceUpdated Mar 4, 2026
Technologies:
How to detect:
Sequential scans perform well only when data is already in shared_buffers or OS cache. When buffers are cold, sequential scan execution time degrades from sub-second to 75+ seconds for the same query. Index scans remain fast (milliseconds) regardless of buffer state.
Recommended action:
Identify queries that frequently run on cold data and force index usage using `set enable_seqscan = false;` session setting or query-level hints. Monitor buffer hit ratios to detect cold cache scenarios. Consider warming critical tables with pg_prewarm extension for frequently accessed data.