- **Description**: Implements a disk-based hash table using **Linear Hashing**. It maps values to 32-bit hash codes and stores them in buckets.
- **Data Structure**:
- **Meta Page**: The single entry point. Stores the **Hash Seed**, the current **Split Point**, and the **Bitmask** used to map hash codes to buckets.
- **Bucket Pages & Overflow Chains**: Each bucket is physically represented by a primary page and zero or more **Overflow Pages** linked together. Every page has a `HashPageOpaqueData` header that stores the "bucket number" and a link to the next page in the chain.
- **Linear Hashing Logic**: Unlike traditional hash tables that double in size, Postgres grows one bucket at a time.
1. A value is hashed to a 32-bit code.
2. Postgres applies the current `low_mask` (`hash & mask`).
3. If the result is less than the `split_point`, it means this bucket has already been divided. Postgres then applies a `high_mask` (`hash & ((mask << 1) | 1)`) to find the new destination.
- **Supported Operators**: `=`.
- **Special Features**:
- **PG 10+ Crash Safety**: Since Postgres 10, Hash indexes are fully WAL-logged, making them safe for production use.
- **Metaphor**: A massive wall of identical mailboxes. The **Meta Page** is the master key that tells you which section of the wall to look at. If one mailbox gets too full, the postman (Linear Hashing) simply adds a new row to the bottom of the wall.