{
  "status": "shipping",
  "advantages": [],
  "limitations": [],
  "supersedes": [],
  "supersededBy": [],
  "firstSeen": null,
  "lastSeen": null,
  "updated": "2026-11-18",
  "slug": "postgresql-hash-index",
  "term": "Hash index (PostgreSQL)",
  "aliases": [
    "PostgreSQL hash index"
  ],
  "definition": "A PostgreSQL hash index is a persistent single-column index that stores hash codes to identify candidates for equality comparisons.",
  "note": "Representation: PostgreSQL 18 stores a four-byte hash value instead of the original indexed value. Equal hashes can represent different values, so candidates require an equality recheck. This is lossy candidate selection, not evidence of damaged data. [pg-hash] [pg-hash-code]\n\nCapabilities: This access method supports equality, not range searches or ordered output. It cannot enforce uniqueness or supply an index-only scan; knowing a candidate's location does not recover its original value. B-tree indexes support a different operation set. [pg-hash-types] [pg-hash-code] [pg-hash-ios]\n\nBitmap distinction: REL_18_0 requests rechecks for both ordinary and bitmap hash scans. Exact tuple offsets in a bitmap do not remove the hash-collision recheck; bitmap page lossiness is a separate loss of location precision. [pg-hash-code] [pg-hash-tbm]\n\nCosts: Completing a bucket scan entails traversing its overflow chain; bucket expansion happens during foreground work. Direct bucket access is not a fixed-I/O or universal speed advantage over a B-tree. [pg-hash]",
  "related": [
    "b-tree",
    "hash-collision",
    "postgresql-index-only-scan"
  ],
  "citations": [
    {
      "id": "pg-hash",
      "title": "PostgreSQL 18: Hash Indexes, capabilities and overflow trade-offs",
      "url": "https://www.postgresql.org/docs/18/hash-index.html",
      "accessed": "2026-11-18"
    },
    {
      "id": "pg-hash-code",
      "title": "PostgreSQL REL_18_0: hash access-method capabilities and mandatory recheck flags",
      "url": "https://github.com/postgres/postgres/blob/REL_18_0/src/backend/access/hash/hash.c",
      "accessed": "2026-11-18"
    },
    {
      "id": "pg-hash-types",
      "title": "PostgreSQL 18: Index Types, equality and range support",
      "url": "https://www.postgresql.org/docs/18/indexes-types.html",
      "accessed": "2026-11-18"
    },
    {
      "id": "pg-hash-ios",
      "title": "PostgreSQL 18: Index-Only Scans and Covering Indexes",
      "url": "https://www.postgresql.org/docs/18/indexes-index-only-scans.html",
      "accessed": "2026-11-18"
    },
    {
      "id": "pg-hash-tbm",
      "title": "PostgreSQL REL_18_0: tuple-ID bitmap precision and candidate rechecks",
      "url": "https://github.com/postgres/postgres/blob/REL_18_0/src/backend/nodes/tidbitmap.c",
      "accessed": "2026-11-18"
    }
  ],
  "provenance": [
    "Definition and limits are scoped to PostgreSQL 18 documentation and REL_18_0 source. The linked Observatory analysis separately records a clean-data PostgreSQL 16.15 collision fixture; neither evidence establishes a speedup or corruption-detection rate."
  ]
}
