How would a tree with depth = 1 be created or would it be like this: http://bit.ly/ygwlEp
Your picture shows a "binary tree", not a "b-tree", these are different.
The "B-tree" works by creating buckets of a given size (assume that MongoDB uses 4k) and arranges the elements in these buckets.
If so, what will be the depth of the tree and the maximum number of children
Please take a look at the Wikipedia entry on B-trees, it should give you the final answer.
For composite keys (say, 2 index variables) there will be two trees.
Only one tree. However, the key stored in the tree is basically a BSON representation of both elements βmergedβ together.
Let's say I use timestamp as an index key. Can I make it like a tree with the first layer as years, the second as a month and the third as a day. Can mongoDB automatically analyze this information?
No, you have no control over the indexing structure.
No MongoDB does not support any special parsing by dates in indexes.
If you are performing a comparison operation for timestamps, you need to send another timestamp.
source share