mongodb索引数据结构 [英] mongodb index data structures
问题描述
从BSON规范可以看出,BSON确实显示了整体类型的特殊处理能力。如果索引只包含int64,我希望索引代码创建更多的性能指标。
也许它有某种形式的歧视联盟?
B-Tree内容基本上只是索引字段的BSON序列化表示,并指向该磁盘的磁盘位置对象。
这是一个链接到代码,它提到了这一点。其实这里是 woCompare
函数,它们在循环索引时使用。
看起来像一个简单的二进制比较,所以更小数据将比较大的数据比较快。
Does mongodb discriminate between indices constructed of small, statically sized elements (lets say numeric types) and those with large variant types (such as strings) ?
From the BSON spec I can see that BSON does show the capacity of special treatment of integral types. I would expect the indexing code to create more performant indices if the index contains only int64's.
Perhaps it has some form of discriminated union ?
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.
这篇关于mongodb索引数据结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!