mongodb中的集合扫描是什么? [英] what is a collection scan in mongodb?

查看:88
本文介绍了mongodb中的集合扫描是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道什么是完整馆藏扫描".但是我有点不确定术语集合扫描"是否适用于使用B树游标的查询.使用基本游标以外的游标的查询是否执行集合扫描?

I'm aware what a "full collection scan" is. But i'm a little unsure if the term "collection scan" applies to queries that use B-tree cursor. Do queries that use a cursor other than the basic cursor perform a collection scan?

推荐答案

简短的答案是两个术语相同,或者说只有完整馆藏扫描".

The short answer is the two terms are the same, or rather there is only "full collection scan".

如果您的查询使用的是B树形光标,则按照定义进行扫描,以使收集的数据遍历索引以便查找查询的文档.

If your query is using a B-tree cursor it is by definition not scanning the collection put is traversing the index in order to find the queried documents.

发生集合扫描,其中没有索引可以满足查询要求,我们必须扫描整个集合,以查找所需的文档.有关所有信息,请参见链接.

A collection scan occurs where no index can satisfy the query and we have to scan the full collection in order to find the required documents. See the link for all the information.

http://docs.mongodb.org/manual/reference/method /cursor.explain/

这篇关于mongodb中的集合扫描是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆