mongdb索引查询优化
来源:互联网 发布:网络问卷调查的问题 编辑:程序博客网 时间:2024/04/30 06:25
Query Selectivity
Some query operations are not selective. These operations cannot useindexes effectively or cannot use indexes at all.
The inequality operators $nin and$ne are notvery selective, as they often match a large portion of the index. As aresult, in most cases, a$nin or$ne query withan index may perform no better than a$nin or$ne query that must scan all documents in a collection.
Queries that specify regular expressions, with inline JavaScriptregular expressions or$regex operator expressions, cannotuse an index with one exception. Queries that specify regularexpressionwith anchors at the beginning of a stringcan use anindex.
$nin $ne 不会走索引
指定正则表达式和 JavaScript 内联函数 都不会走索引,只有一个例外,查询一个集合的字符串开始出使用正则表达式
在合适的情况下,建立索引可以有效地提升查询效率;但是索引对写效率有影响,所以:
1、找出最频繁的,成为瓶颈的查询语句,在列上建立索引
2、避免创建毫无意义的索引
3、在业务负载低时进行索引创建的操作
- mongdb索引查询优化
- Mongdb查询
- 索引和优化查询
- MySQL查询优化---索引
- 查询优化策略---索引
- 使用索引优化查询
- mysql查询索引优化
- 索引与查询优化
- 通过索引优化查询
- mysql查询索引优化
- mysql 查询索引优化
- MySQL 查询 索引 优化
- sql查询优化 索引优化
- sql查询优化 索引优化
- SQL查询优化,索引优化
- sql查询优化 索引优化
- SQL 查询优化 索引优化
- MongDB创建索引
- 盛大【云梯】软件 流氓中的流氓 ,解决eclipse的adb无法启动
- ExtJs之combobox详解
- LINUX如何启动/停止/重启MySQL/卸载/安装
- SharePoint一般公式样例
- 在Android中使用HandlerThread创建线程
- mongdb索引查询优化
- 澳大利亚:确认疑似失联客机残骸还需两三天
- sqlserver2008导出数据到2005的解决方法
- 类初始化顺序
- php中的单引号、双引号和转义字符
- C++单例模式
- C++程序设计----- 运算符的重载 【项目3-分数类中的运算符重载】
- nginx配置文件详解
- 测试:重命名一个文件,指向它的符号链接会不会失效?