全部书籍

专业

应用 关于 Coach 登录 开始阅读

书籍暂未推出简体中文版——当前显示英文版。

Computer Science · 术语表

什么是 Static hashing, extendible hashing, linear hashing?

又称: static hashing · extendible hashing · linear hashing

Definition 21.5 University Computer Science — Year 3 · 第 21 章 — Database Storage and Indexes

Static hashing sends key kk to bucket h(k) mod Nh(k) \bmod N for a fixed number NN of bucket pages; a full bucket chains overflow pages. Extendible hashing keeps a directory of 2d2^d pointers indexed by the last dd bits of h(k)h(k), the global depth; each bucket has a local depth d′≤dd' \le d, the number of bits its keys share, and is named by 2d−d′2^{d-d'} directory entries. A full bucket splits on bit d′d'; if d′=dd' = d, the directory doubles first. Linear hashing has no directory: buckets split one at a time, in a fixed round-robin order, whenever the load passes a threshold, and a bucket already split in the current round is addressed with one more bit.

Extendible hashing with buckets of two keys and h(k) = k. Inserting 3 (binary 11) into the full bucket of the keys ending in 1 needs a second bit: the directory doubles, the bucket splits into 01 and 11, and bucket 0, still of local depth 1, is now named by two entries.
Extendible hashing with buckets of two keys and h(k)=kh(k) = k. Inserting 3 (binary 11) into the full bucket of the keys ending in 1 needs a second bit: the directory doubles, the bucket splits into 01 and 11, and bucket 0, still of local depth 1, is now named by two entries.
在原文中阅读 →