IT lexicon › Database › BRIN

BRIN Block Range INdex

Database På svenska → Updated: 2026-07-29

A PostgreSQL index type that stores the minimum and maximum value per group of pages instead of one entry per row. It is therefore absurdly small — kilobytes for a table of hundreds of gigabytes.

On a query the planner skips every block range whose min–max cannot contain the answer and reads only the rest. This works brilliantly under one condition: the physical order must correlate with the value. A log table where rows are appended in time order is the ideal case — the blocks end up in time order automatically. If the values are scattered across the table, every range can contain anything and the index is worthless. So the choice isn't "BRIN or B-tree" but "BRIN when the data already sits in the right order". Introduced in version 9.5 (2016) and common in time series data.

← Back to the lexicon