以色列人说什么语言| yet是什么意思| 黎明是什么时候| 全身皮肤痒是什么原因| 汗臭味很重是什么原因引起的| 右肾盂分离是什么意思| 咽喉炎用什么药| 阴囊湿疹用什么药膏| 拉油便是什么原因| 保健是什么意思| 蟋蟀是靠什么发声的| 什么时候测试怀孕最准确的| 马齿苋什么人不能吃| 嗓子疼看什么科室| editor是什么意思| 泰州有什么好玩的地方| 阴囊潮湿挂什么科| 垂体是什么意思| 慢阻肺吃什么药最有效| 心如所愿的意思是什么| 姓兰的是什么民族| 什么是尿失禁| 脸上突然长痣是什么原因| 康复治疗学学什么| 什么的小学生| 吞服是什么意思| 羧甲基纤维素钠是什么| 黄体回声是什么意思| 六月初六什么日子| 1月22号什么星座| 为什么会出现眼袋| 吃什么排气| 999是什么电话| 太阳五行属什么| 骨裂是什么感觉| dn是什么意思| 探索是什么意思| 龙凤呈祥代表什么生肖| 教师节送老师什么礼物最好| 基因突变是什么意思| 越吃越瘦是什么原因| 什么一气| 帕金森病是什么原因引起的| 月经不来要吃什么药| 皮重是什么意思| gsp全称是什么| 保肝护肝吃什么药好| 手淫对身体有什么伤害| 啤酒和什么不能一起吃| 流产后吃什么药| 羞耻是什么意思| 早退是什么意思| 什么的鹿角| 高筋面粉和低筋面粉有什么区别| 绘本是什么意思| 榴莲与什么食物相克| 什么情况下需要切除子宫| 桥本氏甲状腺炎是什么意思| 养血清脑颗粒治什么病| 大姨妈很多血块是什么原因| 牙疼吃什么药| 学字五行属什么| 榴莲什么人不适合吃| 吃蒲公英有什么好处| 痔疮是什么样的| 胎梦梦见蛇是什么意思| 周瑜和诸葛亮是什么关系| 人体第一道防线是什么| 茗字五行属什么| 摄人心魄是什么意思| 大宗物品是什么意思| 蚕长什么样| 全血是什么意思| 情劫什么意思| 什么字五行属土| 梦见自己死了是什么预兆| 冰释前嫌的释是什么意思| 扒皮是什么意思| 海参不能和什么一起吃| 健康管理师是干什么的| 家产是什么意思| 液氧是什么| 农历五月十九是什么日子| 荷花的花语是什么| 就坡下驴什么意思| 太虚幻境是什么意思| 吃什么长卵泡| 人为什么要喝水| 会厌炎吃什么药最有效| 什么字五行属土| cba是什么意思| 接吻有什么好处| 低骨量是什么意思| cnd是什么意思| 爱是什么意思| 癌抗原125是什么意思| 螺旋杆菌吃什么药| 发呆表情是什么意思| 高会是什么意思| 血小板聚集是什么意思| 半月板变性是什么意思| 曹操的小名叫什么| 喝红酒有什么好处| 勇者胜的上半句是什么| CAT是什么| 寒门子弟是什么意思| 体液是指什么| 心无什么用| 吃什么长胸| 孕晚期破水是什么症状| 减肥可以吃什么菜| 右枕前位是什么意思| 文科生选什么专业| 老鼠疣长什么样子图片| 肚脐眼上面疼是什么原因| 奇异果是什么水果| 乐的五行属性是什么| 为什么眼睛会肿而且痛| 梦见自己怀孕生孩子是什么意思| 推举是什么意思| 正常人尿液是什么颜色| 鲶鱼是什么鱼| 6月份生日是什么星座| 米是什么结构| 工字可以加什么偏旁| 制动是什么| 什么是hpv病毒| 楚门的世界是什么意思| 风口浪尖是什么意思| 为什么门牙突然有缝了| 珍贵的动物是什么生肖| 圣罗兰为什么叫杨树林| 儿童鸡胸挂什么科| 外阴长什么样| 血糖高吃什么主食| 诺如病毒吃什么药好得快一点| 4月2号什么星座| 大脑供血不足吃什么药最好| 什么是脑梗| 乳腺ca是什么意思| 牛蛙和青蛙有什么区别| 下面痒用什么清洗最好| 天之骄子是什么意思| 74年出生属什么生肖| 乌鸡卷是什么肉做的| 西凤酒属于什么香型| 唯利是图是什么生肖| 天麻与什么煲汤最好| 矫枉过正什么意思| 梦见金项链是什么意思| 扁桃体发炎吃什么水果| 标准差是什么| 为什么很多人不去庐山| 什么是涤纶面料| 同仁是什么意思| 什么是钼靶检查| 狗肉炖什么好吃| 违心的话是什么意思| 副区长什么级别| roca是什么品牌| 脂溢性皮炎头皮用什么洗发水| 小雪时节吃什么| 男性生殖长水泡是什么原因| crh是什么意思| 右枕前位是什么意思| 生脉饮适合什么人群| 梦见买帽子是什么意思| 恪尽职守是什么意思| 吃荆芥有什么好处| 祭坛是什么意思| 乳头大是什么原因| 走马观花是什么意思| 东方美人茶属于什么茶| h是什么元素| 胎儿双顶径偏大是什么原因| macd什么意思| 不什么而什么| 玄孙是什么意思| 拉肚子吃什么好得快| 手脚不协调是什么原因| 乳房胀痛是什么原因引起的| 屎是什么味道的| 为什么得带状疱疹| 幽闭恐惧症是什么| 重阳节吃什么| 印度信仰什么教| 奇花初胎矞矞皇皇是什么意思| 卵泡长得慢是什么原因造成的| 好人是什么意思| 伙计是什么意思| 便秘去药店买什么药吃| 专科有什么专业| 官方翻新机是什么意思| 四大皆空是什么意思| 骨质增生吃什么药好| 幽门螺旋杆菌的症状是什么| 胃胀痛吃什么药好| 凌迟是什么意思| 田宅宫是什么意思| 胃酸是什么颜色的| 危楼是什么意思| 刺梨根泡酒有什么功效| 长期熬夜有什么危害| cva医学上是什么意思| 大姨妈是黑色是什么原因| 什么是海市蜃楼| 额是什么意思| 11.7号是什么星座| 胎盘位于子宫前壁是什么意思| 八字七杀是什么意思| 白羊女喜欢什么样的男生| 耳浴10分钟什么意思| 乳房有溢液是什么原因| 孕妇梦见自己出轨是什么意思| 珍珠龟吃什么| 萝卜丁口红什么牌子| 屎是什么味道| 什么的拼音怎么写| 伏天吃羊肉有什么好处| 狗嚎叫有什么预兆| 肛瘘是什么症状| 死灰复燃是什么意思| 农历六月初四是什么日子| 农历六月十九是什么星座| dha有什么作用与功效| 肝火旺盛吃什么药效果最好| 土茯苓与茯苓有什么区别| 查高血压挂什么科| 什么的眉头| 麻瓜是什么意思| 什么精什么神| 紫癜吃什么好得快| 煮沸除氯是什么意思| 做梦梦见猪是什么意思| 舌头两边锯齿状是什么原因| 子卯相刑有什么危害| 虾青素是什么| 厚黑学的精髓是什么| 注意地看的词语是什么| 虚火旺吃什么去火最快| 眉目比喻什么| 额头上长小疙瘩是什么原因| 灰猫是什么品种| 肾虚吃什么食物| 石斛什么功效| 恨铁不成钢是什么意思| 总是犯困是什么原因| 煎中药用什么锅| 痛风吃什么| 腿纹不对称有什么影响| 膈肌痉挛是什么症状| 什么茶女人长期喝最好| 驴血是什么颜色| 不排卵是什么原因| 贫血是什么原因引起的| 吃了避孕药有什么副作用| 长痘吃什么水果| 早搏应该吃什么药| 睡眠不好吃什么| 钦字五行属什么| 左卡尼汀口服溶液主要治疗什么| 生酮是什么意思| 手机合约版是什么意思| 什么是单反相机| 百度Jump to content

自治区话剧团开展“四讲四爱”下乡慰问演出

From Wikipedia, the free encyclopedia
百度 与此对应的是,新成立自然资源部,合并国家海洋局的职责,并对外保留国家海洋局牌子;不再设立中央维护海洋权益工作领导小组,有关职责交由中央外事工作委员会及其办公室承担,并在办公室内设维护海洋权益工作办公室。

Extendible hashing is a type of hash system which treats a hash as a bit string and uses a trie for bucket lookup.[1] Because of the hierarchical nature of the system, re-hashing is an incremental operation (done one bucket at a time, as needed). This means that time-sensitive applications are less affected by table growth than by standard full-table rehashes.

Extendible hashing was described by Ronald Fagin in 1979. Practically all modern filesystems use either extendible hashing or B-trees. In particular, the Global File System, ZFS, and the SpadFS filesystem use extendible hashing.[2]

Example

[edit]

Assume that the hash function returns a string of bits. The first bits of each string will be used as indices to figure out where they will go in the "directory" (hash table), where is the smallest number such that the index of every item in the table is unique.

Keys to be used:

Let's assume that for this particular example, the bucket size is 1. The first two keys to be inserted, k1 and k2, can be distinguished by the most significant bit, and would be inserted into the table as follows:

Now, if k3 were to be hashed to the table, it wouldn't be enough to distinguish all three keys by one bit (because both k3 and k1 have 1 as their leftmost bit). Also, because the bucket size is one, the table would overflow. Because comparing the first two most significant bits would give each key a unique location, the directory size is doubled as follows:

And so now k1 and k3 have a unique location, being distinguished by the first two leftmost bits. Because k2 is in the top half of the table, both 00 and 01 point to it because there is no other key to compare to that begins with a 0.

The above example is from Fagin et al. (1979).

Further detail

[edit]

Now, k4 needs to be inserted, and it has the first two bits as 01..(1110), and using a 2 bit depth in the directory, this maps from 01 to Bucket A. Bucket A is full (max size 1), so it must be split; because there is more than one pointer to Bucket A, there is no need to increase the directory size.

What is needed is information about:

  1. The key size that maps the directory (the global depth), and
  2. The key size that has previously mapped the bucket (the local depth)

In order to distinguish the two action cases:

  1. Doubling the directory when a bucket becomes full
  2. Creating a new bucket, and re-distributing the entries between the old and the new bucket

Examining the initial case of an extendible hash structure, if each directory entry points to one bucket, then the local depth should be equal to the global depth.

The number of directory entries is equal to 2global depth, and the initial number of buckets is equal to 2local depth.

Thus if global depth = local depth = 0, then 20 = 1, so an initial directory of one pointer to one bucket.

Back to the two action cases; if the bucket is full:

  1. If the local depth is equal to the global depth, then there is only one pointer to the bucket, and there is no other directory pointers that can map to the bucket, so the directory must be doubled.
  2. If the local depth is less than the global depth, then there exists more than one pointer from the directory to the bucket, and the bucket can be split.

Key 01 points to Bucket A, and Bucket A's local depth of 1 is less than the directory's global depth of 2, which means keys hashed to Bucket A have only used a 1 bit prefix (i.e. 0), and the bucket needs to have its contents split using keys 1 + 1 = 2 bits in length; in general, for any local depth d where d is less than D, the global depth, then d must be incremented after a bucket split, and the new d used as the number of bits of each entry's key to redistribute the entries of the former bucket into the new buckets.

Now,

is tried again, with 2 bits 01.., and now key 01 points to a new bucket but there is still ?? in it ( and also begins with 01).

If ?? had been 000110, with key 00, there would have been no problem, because ?? would have remained in the new bucket A' and bucket D would have been empty.

(This would have been the most likely case by far when buckets are of greater size than 1 and the newly split buckets would be exceedingly unlikely to overflow, unless all the entries were all rehashed to one bucket again. But just to emphasize the role of the depth information, the example will be pursued logically to the end.)

So Bucket D needs to be split, but a check of its local depth, which is 2, is the same as the global depth, which is 2, so the directory must be split again, in order to hold keys of sufficient detail, e.g. 3 bits.

  1. Bucket D needs to split due to being full.
  2. As D's local depth = the global depth, the directory must double to increase bit detail of keys.
  3. Global depth has incremented after directory split to 3.
  4. The new entry ?? is rekeyed with global depth 3 bits and ends up in D which has local depth 2, which can now be incremented to 3 and D can be split to D' and E.
  5. The contents of the split bucket D, ??, has been re-keyed with 3 bits, and it ends up in D'.
  6. K4 is retried and it ends up in E which has a spare slot.

Now, is in D and is tried again, with 3 bits 011.., and it points to bucket D which already contains ?? so is full; D's local depth is 2 but now the global depth is 3 after the directory doubling, so now D can be split into bucket's D' and E, the contents of D, ?? has its retried with a new global depth bitmask of 3 and ?? ends up in D', then the new entry ?? is retried with bitmasked using the new global depth bit count of 3 and this gives 011 which now points to a new bucket E which is empty. So ?? goes in Bucket E.

Example implementation

[edit]

Below is the extendible hashing algorithm in Python, with the disc block / memory page association, caching and consistency issues removed. Note a problem exists if the depth exceeds the bit size of an integer, because then doubling of the directory or splitting of a bucket won't allow entries to be rehashed to different buckets.

The code uses the least significant bits, which makes it more efficient to expand the table, as the entire directory can be copied as one block (Ramakrishnan & Gehrke (2003)).

Python example

[edit]
PAGE_SZ = 10

class Page:
    def __init__(self) -> None:
        self.map = []
        self.local_depth = 0

    def full(self) -> bool:
        return len(self.map) >= PAGE_SZ

    def put(self, k, v) -> None:
        for i, (key, value) in enumerate(self.map):
            if key == k:
                del self.map[i]
                break
        self.map.append((k, v))

    def get(self, k):
        for key, value in self.map:
            if key == k:
                return value

    def get_local_high_bit(self):
      return 1 << self.local_depth

class ExtendibleHashing:
    def __init__(self) -> None:
        self.global_depth = 0
        self.directory = [Page()]

    def get_page(self, k):
        h = hash(k)
        return self.directory[h & ((1 << self.global_depth) - 1)]

    def put(self, k, v) -> None:
        p = self.get_page(k)
        full = p.full()
        p.put(k, v)
        if full:
            if p.local_depth == self.global_depth:
                self.directory *= 2
                self.global_depth += 1

            p0 = Page()
            p1 = Page()
            p0.local_depth = p1.local_depth = p.local_depth + 1
            high_bit = p.get_local_high_bit()
            for k2, v2 in p.map:
                h = hash(k2)
                new_p = p1 if h & high_bit else p0
                new_p.put(k2, v2)

            for i in range(hash(k) & (high_bit - 1), len(self.directory), high_bit):
                self.directory[i] = p1 if i & high_bit else p0
         
  
    def get(self, k):
        return self.get_page(k).get(k)

if __name__ == "__main__":
    eh = ExtendibleHashing()
    N = 10088
    l = list(range(N))

    import random
    random.shuffle(l)
    for x in l:
        eh.put(x, x)
    print(l)

    for i in range(N):
        print(eh.get(i))

Notes

[edit]
  1. ^ Fagin et al. (1979).
  2. ^ Mikulá? Patocka (2006). Design and Implementation of the Spad Filesystem (PDF) (Thesis). Archived from the original (PDF) on 2025-08-07. Retrieved 2025-08-07. "Section 4.1.6 Extendible hashing: ZFS and GFS" and "Table 4.1: Directory organization in filesystems"

See also

[edit]

References

[edit]
  • Fagin, R.; Nievergelt, J.; Pippenger, N.; Strong, H. R. (September 1979), "Extendible Hashing - A Fast Access Method for Dynamic Files", ACM Transactions on Database Systems, 4 (3): 315–344, doi:10.1145/320083.320092, S2CID 2723596
  • Ramakrishnan, R.; Gehrke, J. (2003), Database Management Systems, 3rd Edition: Chapter 11, Hash-Based Indexing, pp. 373–378
  • Silberschatz, Abraham; Korth, Henry; Sudarshan, S., Database System Concepts, Sixth Edition: Chapter 11.7, Dynamic Hashing
[edit]
粽子叶是什么植物的叶子 Fish什么意思 正常大便是什么颜色 电子邮件地址是什么意思 孕酮是什么意思
糖尿病吃什么主食 为什么会排卵期出血 尿液中粘液丝高是什么原因 凉虾是什么 梦见死人是什么征兆
提高免疫力吃什么食物 蓝朋友什么意思 化验血常规能查出什么 一片狼藉是什么意思 积是什么意思
梦见剃光头是什么预兆 血脂高吃什么药好 金牛座和什么星座最配 什么精什么神 肩胛骨突出是什么原因
尿酸高吃什么肉hcv9jop0ns5r.cn 自由意志是什么意思hcv8jop1ns0r.cn 40年是什么婚姻hcv9jop4ns4r.cn 什么是地沟油hcv7jop4ns8r.cn 去侍庙有什么禁忌hcv9jop4ns2r.cn
小猫喜欢什么颜色hcv8jop1ns8r.cn 为什么喝牛奶会长痘shenchushe.com 乳腺囊肿有什么症状hcv8jop9ns0r.cn 喝茶心慌的人什么体质hcv7jop7ns3r.cn 善罢甘休的意思是什么hcv9jop2ns4r.cn
梦见掉牙齿是什么征兆hcv7jop5ns3r.cn 科技布是什么材质hcv9jop5ns2r.cn 日加个成念什么hcv8jop3ns0r.cn 脐疝是什么aiwuzhiyu.com 耳根有痣代表什么hcv7jop5ns0r.cn
珂润属于什么档次hcv8jop5ns0r.cn 智能手环是干什么用的hcv8jop7ns8r.cn 什么是高利贷hcv9jop6ns9r.cn 肺炎支原体抗体阴性是什么意思hcv9jop4ns1r.cn 什么是心肌缺血hcv9jop4ns4r.cn
百度