postgresql-hash-index · shipping · also PostgreSQL hash index

Hash index (PostgreSQL)

A PostgreSQL hash index is a persistent single-column index that stores hash codes to identify candidates for equality comparisons.

Related Observatory article: Read on hesela.com

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. [1] [2]

Capabilities: 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. [3] [2] [4]

Bitmap 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. [2] [5]

Costs: 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. [1]

Relations

related
B-tree, Hash collision, Index-only scan (PostgreSQL)

Citations

  1. PostgreSQL 18: Hash Indexes, capabilities and overflow trade-offs (accessed 2026-11-18)
  2. PostgreSQL REL_18_0: hash access-method capabilities and mandatory recheck flags (accessed 2026-11-18)
  3. PostgreSQL 18: Index Types, equality and range support (accessed 2026-11-18)
  4. PostgreSQL 18: Index-Only Scans and Covering Indexes (accessed 2026-11-18)
  5. PostgreSQL REL_18_0: tuple-ID bitmap precision and candidate rechecks (accessed 2026-11-18)
Sources & caveats
  • 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.

JSON: /data/terms/postgresql-hash-index.json

Published by Hesela team · Updated

Report a correction · Editorial standards · Reuse guidance

Cite this page
Hesela team. Hash index (PostgreSQL). Hesela. 2026-11-18. https://hesela.dev/terms/postgresql-hash-index/