#8884·citus

Use BufferAccessStrategy for columnar scans to avoid buffer cache pollution

Author: ihalatciCreated Sep 28, 2026Updated Sep 28, 2026

Problem

Columnar table scans do not provide a BufferAccessStrategy, so a large sequential columnar scan can evict nearly the entire co-resident hot buffer set.

This was discovered while evaluating PostgreSQL 19 asynchronous I/O and pg_stat_io integration in #8773, but it is not specific to PostgreSQL 19. Columnar reads are already visible in pg_stat_io, and the read path already reaches PostgreSQL's asynchronous buffer APIs; the actionable gap is buffer-cache behavior.

Evidence

In the measured workload:

  • one cold columnar scan evicted approximately 99.99% of a co-resident hot set;
  • a heap scan reading approximately 2.4x more bytes did not cause equivalent eviction because it used an appropriate buffer access strategy;
  • pg_stat_io accurately reported columnar reads, including column pruning, so observability is not the missing feature.

The relevant columnar data read is in ReadFromBlock() in src/backend/columnar/columnar_storage.c. The extend and write paths are not part of this issue.

Proposed direction

Evaluate passing a bulk-read BufferAccessStrategy through the columnar stripe/chunk scan path. Benchmark cache retention, throughput, and interaction with PostgreSQL read streams before selecting an implementation.

Acceptance criteria

  • A large columnar scan no longer evicts nearly all of an unrelated hot buffer set.
  • Column pruning and existing columnar correctness remain unchanged.
  • Benchmarks compare cold/warm throughput and cache retention against current columnar and heap behavior.
  • The change is validated across supported PostgreSQL versions; it must not be treated as PG19-only.

Extracted from #8773 so that the PG19 feature umbrella can close the disproven/deferred AIO assessment without losing this version-neutral finding.