Menu

1 / 2

Our PostgreSQL 17 BRIN index recipe for a 2TB time‑series table: 100x smaller than B‑tree

DEV Community·ANKUSH CHOUDHARY JOHAL·6 months ago
#qX4uKm31
#developer#benchmark#postgres#brin#index
Reading 0:00
15s threshold

When our 2TB time-series table’s B-tree index hit 18GB, query latency spiked to 2.1s and vacuum operations took 14 hours. Switching to PostgreSQL 17’s BRIN indexes cut index size to 180MB—100x smaller—slashed p99 latency to 89ms, and reduced vacuum time to 47 minutes. Here’s exactly how we did it, with benchmark-backed code and real-world tradeoffs.

📡 Hacker News Top Stories Right Now

Why does it take so long to release black fan versions? (256 points)

How fast is a macOS VM, and how small could it be? (11 points)

Why are there both TMP and TEMP environment variables?…

Continue reading — create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.