What are the differences between B trees and B+ trees?

后端 未结 14 2867
孤城傲影
孤城傲影 2020-12-02 03:18

In a b-tree you can store both keys and data in the internal and leaf nodes, but in a b+ tree you have to store the data in the

14条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-02 04:02

    One possible use of B+ trees is that it is suitable for situations where the tree grows so large that it does not fit into available memory. Thus, you'd generally expect to be doing multiple I/O's.
    It does often happen that a B+ tree is used even when it in fact fits into memory, and then your cache manager might keep it there permanently. But this is a special case, not the general one, and caching policy is a separate from B+ tree maintenance as such.

    Also, in a B+ tree, the leaf pages are linked together in a linked list (or doubly-linked list), which optimizes traversals (for range searches, sorting, etc.). So the number of pointers is a function of the specific algorithm that is used.

提交回复
热议问题