1. Gyanastra
  2. Database Systems
  3. Linear Hashing and Hash Versus Index Comparison
  4. When is a split triggered? (load-factor trigger)
Free lesson, no account needed 4 min read

Database Systems · Linear Hashing and Hash Versus Index Comparison

When is a split triggered? (load-factor trigger)

Linear hashing always splits bucket pp (the split pointer's bucket), not necessarily the bucket that overflowed. Two triggers appear in textbooks: (i) load factor — split when the global load factor exceeds a threshold θ\theta (like 0.750.75 or 1.01.0); (ii) overflow — split whenever an insertion causes an overflow (the simple variant in Elmasri–Navathe and Ramakrishnan–Gehrke). This chapter uses the load-factor trigger; follow the trigger stated in the question.

Trigger condition (records-per-bucket form, most common in GATE): nb>θ⟹split one bucket, then insert.\frac{n}{b} > \theta \quad\Longrightarrow\quad \text{split one bucket, then insert.}

Capacity form (Elmasri–Navathe): with capacity cc, nb⋅c>θ.\frac{n}{b\cdot c} > \theta .

Procedure on each insertion of key KK:

  1. Insert KK into its correct bucket (using the search rule). If the bucket is full, put it in an overflow chain.
  2. Increment nn.
  3. If n/b>θn/b > \theta (or n/(bc)>θn/(bc) > \theta): perform one split of bucket pp:
    • Create new bucket number bb (the next free address).
    • Redistribute records of bucket pp and the new bucket using hi+1h_{i+1}: records with hi+1=ph_{i+1}=p stay, records with hi+1=p+M⋅2ih_{i+1}=p+M\cdot2^i go to the new bucket.
    • p←p+1p \leftarrow p+1; b←b+1b \leftarrow b+1.
    • If p=M⋅2ip = M\cdot2^i: round ends → i←i+1i\leftarrow i+1, p←0p\leftarrow 0 (MM is unchanged).

Trap: only one split per insertion, even if the load factor is still above θ\theta after the split. (Some variants split until below θ\theta; the standard textbook version splits once per insertion. If a question says "split until load factor ≤ θ", do that instead — read the wording.)


Pages 1–2 of 2