mongodb index data structures

后端 未结 1 1641
无人共我
无人共我 2020-12-21 15:42

Does mongodb discriminate between indices constructed of small, statically sized elements (lets say numeric types) and those with large variant types (such as strings) ?

相关标签:
1条回答
  • 2020-12-21 16:12

    The B-Tree contents are basically just the BSON serialized representation of the indexed fields and a pointer to the disk location of that object.

    Here is a link to the code where it mentions this. In fact, here is the woCompare function they use while looping through the index.

    Looks to me like a simple binary comparison, so smaller data will compare faster than larger data.

    0 讨论(0)
提交回复
热议问题