宝宝满周岁送什么礼物| 保底和底薪有什么区别| 火奥念什么| 四十岁月经量少是什么原因| 翡翠和玉有什么区别| 5点至7点是什么时辰| 食管在什么位置图片| 玫瑰痤疮吃什么药| 擦伤用什么药好得快| 厍是什么意思| 熙熙攘攘什么意思| mcv偏低是什么意思| 麻风病是什么病| mrd是什么意思| 小腿肌肉痛是什么原因| zro是什么牌子| 什么水果补充维生素c| 什么是包皮| 今年7岁属什么生肖| 山楂炖肉起什么作用| 愤青什么意思| 什么样的人着床晚| 附件囊肿吃什么药最好| 排卵试纸阴性是什么意思| 什么东西能戒酒| 妇科衣原体感染是什么病| 镰刀菌用什么杀菌剂| 胎儿没有胎心是什么原因| 手淫是什么| 来源是什么意思| 胆汁反流性胃炎吃什么中成药| 地奥司明片治疗什么病| ppd试验是什么意思| lo什么意思| 宝宝拉肚子吃什么药好得快| 美团外卖和美团有什么区别| 烧仙草是什么东西| 长骨刺是什么原因导致的| 古天乐属什么生肖| oioi是什么牌子| 屌丝男是什么意思| 什么食物含蛋白质多| 女人喝咖啡有什么好处| 脊椎侧弯挂什么科| 什么人不能念阿弥陀佛| 尿频尿急是什么症状| 钟点房是什么意思| 房产证和土地证有什么区别| 小钢炮是什么意思| 车加尿素起什么作用| 20度穿什么衣服| 三十周年结婚是什么婚| 人活着到底是为了什么| 烟火是什么意思| 白蛋白下降是什么原因| 口酸吃什么药效果好| 涵字五行属什么| 小肚鸡肠是什么意思| 经常胸闷是什么原因| 父亲节该送什么礼物| 美版苹果和国行有什么区别| 前列腺吃什么药好| 有人的地方就有江湖什么意思| Iud是什么| 伤寒病有什么症状| 乙肝表面抗原携带者什么意思| 川崎病有什么症状| 维生素c什么时候吃| 考生号是什么| 岁月如歌下一句是什么| 总胆红素偏高吃什么药| 狗狗的鼻子为什么是湿的| 智是什么意思| 痛风为什么要禁欲| 木辛读什么| 尿蛋白吃什么药| 木加号读什么| 气管炎吃什么药最有效| 胃底腺息肉什么意思| 什么是肛漏| 二氧化碳有什么作用| 红枣和枸杞一起泡水喝有什么作用| 人的本质属性是什么| 喝椰子汁有什么好处| 夷是什么意思| 披萨用什么面粉| 残联是什么性质的单位| gl是什么| 腺样体肥大吃什么药| 刚产下的蚕卵是什么颜色| 彩虹旗是什么意思| 美商是什么意思| 人中长痘是什么原因| 男士皮带什么品牌好| 酮体是什么| 消停是什么意思| 低钾是什么原因引起的| 铁剂不能和什么一起吃| canon是什么意思| 排斥一个人什么意思| 高同型半胱氨酸血症吃什么药| 青睐什么意思| 舌头上有齿痕是什么原因| 系少一撇叫什么| 口比念什么| 地奥司明片治疗什么病| 什么牌子的电动车好| 官官相护是什么意思| 陈皮配什么喝去湿气| 淡墨是什么意思| 23年属什么生肖| 梦见偷别人东西是什么意思| 推手是什么意思| 浛是什么意思| 遥遥相望是什么意思| 食道癌有什么症状| 地球为什么自转| 淋球菌阳性是什么病| 灰指甲看什么科| 火棉胶婴儿是什么意思| 什么情况下会流前列腺液| 一个鸟一个衣是什么字| 世界第一大运动是什么| 都市丽人是什么意思| 妈妈的弟弟的老婆叫什么| 什么淀粉最好| 立秋什么意思| 樵夫是什么意思| 为什么眼皮会一直跳| 丰胸吃什么食物有效果| 什么血型的人最聪明| 牙龈出血是什么原因| s代表什么| 四月十一日是什么星座| 总是爱出汗是什么原因| 女性尿道口有小疙瘩是什么原因| 尿比重是什么意思| 5.3什么星座| 阴唇是什么颜色| 补料是什么意思| 褒义词是什么意思| 工作性质是什么意思| 怀孕了为什么还会出血| 7月属什么生肖| 白天不咳嗽晚上咳嗽吃什么药| 吃什么提高记忆力| 剑桥英语和新概念英语有什么区别| 蔓字五行属什么| 心梗吃什么药效果好| 什么规律| 倚老卖老什么意思| vegan是什么意思| 海螺吃什么食物| 电动汽车什么牌子好| 枸杞泡水喝有什么好处| 织物是什么材质| 晚上适合喝什么茶| 黑豆熟地水功效是什么| 猫字五行属什么| 业力是什么意思| 虎眼石五行属什么| 梦见前男友是什么意思| 虾青素有什么作用| 权志龙为什么叫gd| bolon是什么牌子眼镜| 高压偏低是什么原因造成的| 调停是什么意思| 铁蛋白高吃什么药能降下来| 孕期感冒可以吃什么药| fl是胎儿的什么| 孕激素低吃什么补得快| 什么津津| 地震为什么会发生| 亚铁是什么| 奶茶色是什么颜色| 维生素b12有什么用| 红眼鱼是什么鱼| 鸡肉配什么菜好吃| 白蛇是什么蛇| 369是什么意思| 轻微脑震荡吃什么药| 手腕痛挂什么科| 缺铁有什么症状| 脚痒用什么药好| 检查是否怀孕要做什么检查| 内膜厚吃什么药掉内膜| 肺火吃什么中成药| 狒狒是什么动物| 压疮是什么| snp是什么意思| 天启是什么意思| 火麻是什么植物| 喝什么利尿| 梦见好多蚊子是什么意思| 外阴白斑用什么药| 脾胃寒湿吃什么中成药| 路痴是什么原因造成的| 阴虚吃什么好| 乙肝235阳性是什么意思| 肾积水有什么症状| 包煎是什么意思| 见字五行属什么| 多吃蒜有什么好处和坏处| 人体最大的排毒器官是什么| 什么是夜店| 低gi食物是什么意思| 盐酸盐是什么| 邵字五行属什么| 美甲做多了有什么危害| 强直性脊柱炎有什么症状| 麸皮是什么东西| 颈椎问题挂什么科| 尿味重是什么原因| 角质增生是什么意思| vampire是什么意思| 我拿什么留住你| 艾滋病会有什么症状| 欢子真名叫什么| 太阳穴有痣代表什么| 孕早期吃什么有利于胎心胎芽发育| 足底筋膜炎挂什么科| 矢气是什么意思| 关节炎吃什么药最好| 豆腐干炒什么好吃| 3a是什么| 蛇的天敌是什么动物| 可喜可贺是什么意思| 什么的雾霾| 祈字五行属什么| 有故事的人是什么意思| 春节吃什么| 脚冰冰凉是什么原因| 张家界莓茶有什么功效| copd什么意思| 股骨头在什么位置| 血压高是什么原因引起的| 幽门螺旋杆菌用什么药治疗| 什么是包皮过长图片| 外阴又疼又痒用什么药| 孝是什么| 全身大面积湿疹暗示着什么| 吃百香果有什么好处| 刘备属相是什么生肖| 邓超的老婆叫什么名字| 60大寿送什么礼物| 紫罗兰色是什么颜色| 穆斯林为什么不吃猪肉| 六月不搬家是什么意思| 孙策是孙权的什么人| 四世同堂什么意思| 社保基金是什么| 肺气肿是什么原因导致的| 核医学科主要治什么病| 七月十七是什么星座| 薄凉是什么意思| 青岛是什么省| 茉莉毛尖属于什么茶| 什么是中成药| 拉脱水是什么症状| 直爽是什么意思| hf是什么| 益生菌有什么功效| 结婚55周年是什么婚| soldier是什么意思| 百度Jump to content

乐山犍为启动“五个一”工程 为重点项目护航

From Wikipedia, the free encyclopedia
Fractal tree index
Typetree
Invented2007
Invented byMichael A. Bender, Martin Farach-Colton, Bradley C. Kuszmaul
Time complexity in big O notation
Operation Average Worst case
Search O(logB N) O(logB N)
Insert O(logB N/Bε) O(logB N/Bε)
Delete O(logB N/Bε) O(logB N/Bε)
Space complexity
Space O(N/B) O(N/B)
百度 ”  案例  老问题:核心岗位不爱要女生  很多应届大学毕业生,也和罗女士持相似的观点。

In computer science, a fractal tree index is a tree data structure that keeps data sorted and allows searches and sequential access in the same time as a B-tree but with insertions and deletions that are asymptotically faster than a B-tree. Like a B-tree, a fractal tree index is a generalization of a binary search tree in that a node can have more than two children. Furthermore, unlike a B-tree, a fractal tree index has buffers at each node, which allow insertions, deletions and other changes to be stored in intermediate locations. The goal of the buffers is to schedule disk writes so that each write performs a large amount of useful work, thereby avoiding the worst-case performance of B-trees, in which each disk write may change a small amount of data on disk. Like a B-tree, fractal tree indexes are optimized for systems that read and write large blocks of data. The fractal tree index has been commercialized in databases by Tokutek. Originally, it was implemented as a cache-oblivious lookahead array,[1] but the current implementation is an extension of the Bε tree.[2] The Bε is related to the Buffered Repository Tree.[3] The Buffered Repository Tree has degree 2, whereas the Bε tree has degree Bε. The fractal tree index has also been used in a prototype filesystem.[4][5] An open source implementation of the fractal tree index is available,[6] which demonstrates the implementation details outlined below.

Overview

[edit]

In fractal tree indexes, internal (non-leaf) nodes can have a variable number of child nodes within some pre-defined range. When data is inserted or removed from a node, its number of child nodes changes. In order to maintain the pre-defined range, internal nodes may be joined or split. Each internal node of a B-tree will contain a number of keys that is one less than its branching factor. The keys act as separation values which divide its subtrees. Keys in subtrees are stored in search tree order, that is, all keys in a subtree are between the two bracketing values. In this regard, they are just like B-trees.

Fractal tree indexes and B-trees both exploit the fact that when a node is fetched from storage, a block of memory, whose size is denoted by , is fetched. Thus, nodes are tuned to be of size approximately . Since access to storage can dominate the running time of a data structure, the time-complexity of external memory algorithms is dominated by the number of read/writes a data structure induces. (See, e.g.,[7] for the following analyses.)

In a B-tree, this means that the number of keys in a node is targeted to be enough to fill the node, with some variability for node splits and merges. For the purposes of theoretical analysis, if keys fit in a node, then the tree has depth , and this is the I/O complexity of both searches and insertions.

Fractal trees nodes use a smaller branching factor, say, of . The depth of the tree is then , thereby matching the B-tree asymptotically. The remaining space in each node is used to buffer insertions, deletion and updates, which we refer to in aggregate as messages. When a buffer is full, it is flushed to the children in bulk. There are several choices for how the buffers are flushed, all leading to similar I/O complexity. Each message in a node buffer will be flushed to a particular child, as determined by its key. Suppose, for concreteness, that messages are flushed that are heading to the same child, and that among the children, we pick the one with the most messages. Then there are at least messages that can be flushed to the child. Each flush requires flushes, and therefore the per-message cost of a flush is .

Consider the cost of an insertion. Each message gets flushed times, and the cost of a flush is . Therefore, the cost of an insertion is . Finally, note that the branching factor can vary, but for any branching factor , the cost of a flush is , thereby providing a smooth tradeoff between search cost, which depends on the depth of the search tree, and therefore the branching factor, versus the insertion time, which depends on the depth of the tree but more sensitively on the size of the buffer flushes.

Comparisons with other external-memory indexes

[edit]

This section compares fractal tree indexes with other external memory indexing data structures. The theoretical literature on this topic is very large, so this discussion is limited to a comparison with popular data structures that are in use in databases and file systems.

B-trees

[edit]

The search time of a B-tree is asymptotically the same as that of a fractal tree index. However, a fractal tree index has deeper trees than a B-tree, and if each node were to require an I/O, say if the cache is cold, then a fractal tree index would induce more IO. However, for many workloads most or all internal nodes of both B-trees and fractal tree indexes are already cached in RAM. In this case, the cost of a search is dominated by the cost of fetching the leaf, which is the same in both cases. Thus, for many workloads, fractal tree indexes can match B-trees in terms of search time.

Where they differ is on insertions, deletions and updates. An insertion in a fractal tree index takes whereas B-trees require . Thus, fractal tree indexes are faster than B-trees by a factor of . Since can be quite large, this yields a potential two-order-of-magnitude improvement in worst-case insertion times, which is observed in practice. Both B-trees and fractal tree indexes can perform insertions faster in the best case. For example, if keys are inserted in sequential order, both data structures achieve a I/Os per insertion. Thus, because the best and worst cases of B-trees differ so widely, whereas fractal tree indexes are always near their best case, the actual speedup that fractal tree indexes achieve over B-trees depends on the details of the workload.

Log-structured merge-trees

[edit]

Log-structured merge-trees (LSMs) refer to a class of data structures which consists of two or more index structures of exponentially growing capacities. When a tree at some level reaches its capacity, it is merged into the next bigger level. The IO-complexity of an LSM depends on parameters such as the growth factor between levels and the data structure chosen at each level, so in order to analyze the complexity of LSMs, we need to pick a specific version. For comparison purposes, we select the version of LSMs that match fractal tree indexes on insertion performance.

Suppose an LSM is implemented via B-trees, each of which has a capacity that is larger than its predecessor. The merge time depends on three facts: The sorted order of keys in an -item B-tree can be produced in IOs; Two sorted lists of and items can be merged into a sorted list in IOs; and a B-tree of a sorted list of items can be built in IOs. When a tree overflows, it is merged into a tree whose size is larger, therefore a level that holds items requires IOs to merge. An item may be merged once per level, giving a total time of , which matches the fractal tree index.

The query time is simply the B-tree query time at each level. The query time into the th level is , since the th level has capacity . The total time is therefore . This is larger than both the B-tree and fractal tree indexes by a logarithmic factor. In fact, although B-trees and fractal tree indexes are both on the optimal tradeoff curve between insertions and queries, LSMs are not. They are incomparable with B-trees and are dominated by fractal tree indexes.

A few notes about LSMs: there are ways to make the queries faster. For example, if only membership queries are required and no successor/predecessor/range queries are, then Bloom filters can be used to speed up queries. Also, the growth factor between levels can be set to some other value, giving a range of insertion/query tradeoffs. However, for every choice of insertion rate, the corresponding fractal tree index has faster queries.

Bε trees

[edit]

The fractal tree index is a refinement of the Bε tree. Like a Bε tree, it consists of nodes with keys and buffers and realizes the optimal insertion/query tradeoff. The fractal tree index differs in including performance optimization and in extending the functionality. Examples of improved functionality include ACID semantics. B-tree implementations of ACID semantics typically involve locking rows that are involved in an active transactions. Such a scheme works well in a B-tree because both insertions and queries involve fetching the same leaf into memory. Thus, locking an inserted row does not incur an IO penalty. However, in fractal tree indexes, insertions are messages, and a row may reside in more than one node at the same time. Fractal tree indexes therefore require a separate locking structure that is IO-efficient or resides in memory in order to implement the locking involved in implementing ACID semantics.

Fractal tree indexes also have several performance optimizations. First, buffers are themselves indexed in order to speed up searches. Second, leaves are much larger than in B-trees, which allows for greater compression. In fact, the leaves are chosen to be large enough that their access time is dominated by the bandwidth time, and therefore amortizes away the seek and rotational latency. Large leaves are an advantage with large range queries but slow down point queries, which require accessing a small portion of the leaf. The solution implemented in fractal tree indexes is to have large leaves that can be fetched as a whole for fast range queries but are broken into smaller pieces call basement nodes which can be fetched individually. Accessing a basement node is faster than accessing a leaf, because of the reduced bandwidth time. Thus the substructure of leaves in fractal tree indexes, as compared to Bε trees allows both range and point queries to be fast.

Messaging and fractal tree indexes

[edit]

Insertions, deletions and updates are inserted as message into buffers that make their way towards the leaves. The messaging infrastructure can be exploited to implement a variety of other operations, some of which are discussed below.

Upserts

[edit]

An upsert is a statement that inserts a row if it does not exist and updates it if it does. In a B-tree, an upsert is implemented by first searching for the row and then implementing an insertion or an update, depending on the result of the search. This requires fetching the row into memory if it is not already cached. A fractal tree index can implement an upsert by inserting a special upsert message. Such a message can, in theory, implement arbitrary pieces of code during the update. In practice, four update operations are supported:

  1. (a generalized increment)
  2. (a generalized decrement)
  3. (a decrement with a floor at 0)

These correspond to the update operations used in LinkBench,[8] a benchmark proposed by Facebook. By avoiding the initial search, upsert messages can improve the speed of upserts by orders of magnitude.

Schema changes

[edit]

So far, all message types have modified single rows. However, broadcast messages, which are copied to all outgoing buffers, can modify all rows in a database. For example, broadcast messages can be used to change the format of all rows in a database. Although the total work required to change all rows is unchanged over the brute-force method of traversing the table, the latency is improved, since, once the message is injected into the root buffer, all subsequent queries will be able to apply the schema modification to any rows they encounter. The schema change is immediate and the work is deferred to such a time when buffers overflow and leaves would have gotten updated anyway.

Implementations

[edit]

The fractal tree index has been implemented and commercialized by Tokutek. It is available as TokuDB as a storage engine for MySQL and MariaDB, and as TokuMX, a more complete integration with MongoDB. Fractal tree indexes have also been used in prototype filesystems, TokuFS[4] and BetrFS.[5]

References

[edit]
  1. ^ Bender, M. A.; Farach-Colton, M.; Fineman, J.; Fogel, Y.; Kuszmaul, B.; Nelson, J. (June 2007). "Cache-Oblivious streaming B-trees". Proceedings of the 19th Annual ACM Symposium on Parallelism in Algorithms and Architectures. CA: ACM Press: 81–92.
  2. ^ Brodal, G.; Fagerberg, R. (Jan 2003). "Lower Bounds for External Memory Dictionaries". Proceedings of the Fourteenth Annual ACM-SIAM Symposium on Discrete Algorithms. N.Y.: ACM Press: 546–554.
  3. ^ Buchsbaum, A.; Goldwasswer, M.; Venkatasubramanian, S.; Westbrook, J. (Jan 2000). "On External Memory Graph Traversal". Proceedings of the Eleventh Annual ACM-SIAM Symposium on Discrete Algorithms: 859–860. CiteSeerX 10.1.1.27.9904.
  4. ^ a b Esmet, J.; Bender, M.; Farach-Colton, M.; Kuszmaul, B. (June 2012). "The TokuFS Streaming File System" (PDF). Proceedings of the 4th USENIX Conference on Hot Topics in Storage and File Systems. MA: USENIX Association. p. 14.
  5. ^ a b Jannen, William; Yuan, Jun; Zhan, Yang; Akshintala, Amogh; Esmet, John; Jiao, Yizheng; Mittal, Ankur; Pandey, Prashant; Reddy, Phaneendra; Walsh, Leif; Bender, Michael; Farach-Colton, Martin; Johnson, Rob; Kuszmaul, Bradley C.; Porter, Donald E. (February 2015). "BetrFS: A Right-Optimized Write-Optimized File System" (PDF). Proceedings of the 13th USENIX Conference on File and Storage Technologies. Santa Clara, California.
  6. ^ Github Repository
  7. ^ Cormen, T.; Leiserson, C.E.; Rivest, R.; Stein, C. (2001). Introduction to Algorithms (2nd ed.). MIT Press and McGraw-Hill. ISBN 0-262-03293-7.
珍贵的动物是什么生肖 副脾结节是什么意思 劫色是什么意思 血糖高能吃什么水果 借口是什么意思
腰疼吃什么药效果好 为什么经常口腔溃疡 白醋泡脚有什么好处 什么的嘴巴 肠胃炎应该注意什么
被是什么偏旁怎么读 女生安全期什么意思 慵懒是什么意思 胃气胀是什么原因怎么解决 什么的帽子
白羊女喜欢什么样的男生 小孩子流鼻血是什么原因引起的 妇科衣原体感染是什么病 为什么一站起来就头晕眼前发黑 c1e驾照能开什么车
失而复得什么意思aiwuzhiyu.com 养生馆是干什么的hcv9jop2ns1r.cn 什么可以代替狗狗沐浴露bfb118.com 单纯疱疹病毒吃什么药hcv7jop9ns8r.cn 怎么吃都不胖是什么原因aiwuzhiyu.com
胎盘有什么用hcv9jop4ns5r.cn ck属于什么档次hcv9jop1ns1r.cn 舌炎是什么原因引起的怎样治疗hcv8jop0ns5r.cn 车抛锚是什么意思jinxinzhichuang.com 生长纹是什么原因cl108k.com
1027是什么星座hcv8jop9ns7r.cn 什么是生僻字hcv8jop1ns3r.cn 胸口闷痛什么原因引起的hcv8jop7ns0r.cn 三个土什么字hcv9jop4ns9r.cn 幽门螺旋杆菌是什么症状hcv8jop5ns2r.cn
鸽子怕什么怎么赶走hcv7jop7ns1r.cn 为什么会有胎记hcv9jop5ns0r.cn 什么人容易得肺结核hcv7jop9ns2r.cn 回是什么生肖hcv9jop7ns9r.cn 肌酸是什么hcv8jop0ns8r.cn
百度