Do anyone know why MongoDB use B-Tree but not B+-Tree?
As I know most DBMS use B+-Tree. Are there any special reason for MongoDB to use B-Tree?
thanks.
The maximum BSON document size is 16 megabytes. The maximum document size helps ensure that a single document cannot use excessive amount of RAM or, during transmission, excessive amount of bandwidth. To store documents larger than the maximum size, MongoDB provides the GridFS API.
Definition. $not performs a logical NOT operation on the specified <operator-expression> and selects the documents that do not match the <operator-expression> . This includes documents that do not contain the field .
MongoDB provides different types of comparison operators and inequality or not equals operator( $ne ) is one of them. This operator is used to select those documents where the value of the field does not equal to the given value. It also includes those documents that do not contain the specified field.
The question has confused me when I learned B/B+.Now I get some answers:
select * from xx where id > 23
). So the advantages of B+ tree aren't obvious.In my opinion, it depends on the details how mongo implements.But I am not a Mongo developer. :D
MongoDB uses B+ by WiredTiger default storage engine.
1、https://docs.mongodb.com/manual/core/wiredtiger/
Starting in MongoDB 3.2, the WiredTiger storage engine is the default storage engine.
2、http://source.wiredtiger.com/3.2.1/tune_page_size_and_comp.html
WiredTiger maintains a table's data in memory using a data structure called a B-Tree ( B+ Tree to be specific), referring to the nodes of a B-Tree as pages. Internal pages carry only keys. The leaf pages store both keys and values.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With