{
  "slug": "brin",
  "term": "Block Range Index (BRIN)",
  "aliases": [
    "BRIN",
    "BRIN index",
    "PostgreSQL BRIN",
    "Block Range Index"
  ],
  "definition": "A PostgreSQL BRIN index summarizes groups of adjacent heap pages so queries can exclude page ranges that cannot satisfy their conditions.",
  "note": "Candidates: The executor rechecks rows in candidate ranges; a candidate need not match. BRIN is not just min-max: PostgreSQL 18 also has minmax-multi, inclusion and Bloom classes. [pg-brin]\n\nGranularity: pages_per_range counts heap pages, not rows or Parquet pages; PostgreSQL 18 defaults to 128. Finer ranges cost more summaries but may prune better. [pg-brin-options]\n\nCoverage: An unsummarized range remains a scan candidate, not an empty range. This is not protection against corrupt index metadata. [pg-brin-design]\n\nMaintenance: autosummarize defaults to off. brin_summarize_new_values() covers missing summaries. brin_summarize_range() covers a range only if it is unsummarized; it does not refresh an existing summary. Desummarizing then summarizing can tighten bounds after deletions, not verify integrity. [pg-brin-maintenance]\n\nNative check: In PostgreSQL 16.15, DELETE and VACUUM left broad bounds; rebuilding avoided one heap block and 100 rejections without changing answers. Three fresh-cluster repeats covered 42 stage/query observations on a one-page fixture with forced plans; not speed or physical-I/O measurements, nor PostgreSQL 18 execution. [hesela-brin-native]\n\nInspection: Follow the range-map pointer. After desummarization, the raw page scan still exposed an old tuple although its range-map entry was invalid; it was not an active summary. [hesela-brin-native] [pg-brin16-revmap]",
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "related": [
    "zone-map",
    "bloom-filter"
  ],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-18",
  "citations": [
    {
      "id": "pg-brin",
      "title": "PostgreSQL 18: BRIN indexes and operator classes",
      "url": "https://www.postgresql.org/docs/18/brin.html",
      "accessed": "2026-11-18"
    },
    {
      "id": "pg-brin-options",
      "title": "PostgreSQL 18: CREATE INDEX, BRIN storage parameters",
      "url": "https://www.postgresql.org/docs/18/sql-createindex.html",
      "accessed": "2026-11-18"
    },
    {
      "id": "pg-brin-design",
      "title": "PostgreSQL REL_18_0: BRIN scan and unsummarized-range design",
      "url": "https://github.com/postgres/postgres/blob/REL_18_0/src/backend/access/brin/README",
      "accessed": "2026-11-18"
    },
    {
      "id": "pg-brin-maintenance",
      "title": "PostgreSQL 18: index maintenance functions",
      "url": "https://www.postgresql.org/docs/18/functions-admin.html#FUNCTIONS-ADMIN-INDEX",
      "accessed": "2026-11-18"
    },
    {
      "id": "hesela-pruning",
      "title": "Hesela: candidate pruning is not integrity verification",
      "url": "https://hesela.com/analyses/parquet-checksums-read-coverage/#brin-candidates",
      "accessed": "2026-11-18"
    },
    {
      "id": "hesela-brin-native",
      "title": "Hesela: native PostgreSQL 16.15 BRIN maintenance, replay and observations",
      "url": "https://hesela.dev/research/brin-maintenance/README.md",
      "accessed": "2026-11-18"
    },
    {
      "id": "pg-brin16-revmap",
      "title": "PostgreSQL REL_16_15: range-map lookup and desummarization",
      "url": "https://github.com/postgres/postgres/blob/REL_16_15/src/backend/access/brin/brin_revmap.c",
      "accessed": "2026-11-18"
    }
  ],
  "provenance": [
    "PostgreSQL 18 documentation synthesis, plus a separate native PostgreSQL 16.15 controlled experiment recorded 2026-11-18; no PostgreSQL 18 execution or performance measurement.",
    "Author-verified synthetic fixtures, exact sequential-result controls and three fresh-cluster repetitions; no independent scientific replication."
  ]
}
