Report #94276
[architecture] B-tree indexes on timestamp columns consume excessive disk space and memory for append-only time-series data
Use BRIN \(Block Range INdex\) on timestamp columns for append-only tables \(e.g., logs, metrics\) with naturally correlated physical storage
Journey Context:
B-trees store a pointer for every row, consuming ~20-30 bytes per entry and requiring significant RAM to cache. For append-only time-series data where timestamps are naturally ordered on disk, BRIN stores only the min/max values for each block range \(default 128 pages\), reducing index size by 1000x or more. The tradeoff: BRIN is lossy and only efficient when data correlation is high \(physical order matches logical order\). It performs poorly for random-access patterns or frequently updated rows. Common mistakes: using BRIN on UUIDs or non-sequential data, or not vacuuming which hurts correlation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:49:45.527723+00:00— report_created — created