【发布时间】:2019-06-29 12:07:23
【问题描述】:
MongoDB 的 explain("executionStats") 的输出中是否有任何元素提供了一个想法或提示 - 查询是否使用给定的索引进行过滤或排序或两者兼而有之?
我阅读了以下网址
Mongodb compound indexes for filtering and sorting on BIG collection [指向以下网址并进行简短讨论]
https://emptysqua.re/blog/optimizing-mongodb-compound-indexes/ [这个给出了总体思路,但是解释输出使用了我正在使用的 Mongodb 4.0 中不存在的旧格式/元素]
https://docs.mongodb.com/manual/tutorial/sort-results-with-indexes/ [记录如何确定索引和利用索引前缀,但确实显示了确认使用的解释输出]
【问题讨论】: