Nine Megabytes Of Index
An append-only events table has reached 900 GB. Rows are inserted in created_at order and never updated. The B-tree on created_at is 41 GB and every insert dirties a leaf page. Every query filters a six hour window. A colleague proposes replacing it with:
CREATE INDEX events_brin ON events USING BRIN (created_at)
WITH (pages_per_range = 128);
which builds in minutes and occupies 9 MB. What is the honest characterization of that trade?
Sign in to answer questions and track your progress
Sign In