【发布时间】:2012-06-09 11:13:49
【问题描述】:
玩过之后
db.largecollection.find( { $or : [ { identifierX : "sha1_hash123" } , { identifierY : "md5_hash456" } , { identifierZ : "another_hash789" } ] } )
我检查了 mongodb 自动准备的索引。除了标识符 x/y/z 的“单个”ensureIndex 之外,现在还有一个标识符 X_1_identifierY_1_identifierZ_1,性能下降:-(
你有什么想法或提示如何向 mongodb 解释使用单个标识符的索引更快,因为我没有 $and,但是 $or 查询?
谢谢
【问题讨论】:
标签: mongodb indexing mongodb-indexes