N1QL错误索引扫描超时 - 原因:索引扫描超时 [英] N1QL Error Index scan timed out - cause: Index scan timed out

查看:372
本文介绍了N1QL错误索引扫描超时 - 原因:索引扫描超时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在couchbase 4.1.0上面临一个问题,它通过CBQ对大约2000万个文档运行查询。执行我的查询时,在超时2分钟后打印此错误:

I'm facing an issue on couchbase 4.1.0 running a query through CBQ against about 20 Million documents. When executing my query this error is printed after a 2 minute timeout:


code:12015,

"code": 12015,

msg:索引扫描超时 - 原因:索引扫描超时。

"msg": "Index scan timed out - cause: Index scan timed out".

我的问题是这个


  1. 什么是一个索引扫描(这是一个扫描,寻找适当的索引使用或什么?

  2. 是什么导致这样的错误

  3. 查询数据集这个大小超出了couchbase的能力?


推荐答案

索引扫描是寻找的过程对于索引中的查询谓词。例如,如果你有一个名为a的字段和一个名为ix_a的字段的索引,则查询SELECT * FROM bucket where A = 123将对索引ix_a执行索​​引扫描寻找值123.正如Gerald在评论中指出的那样,默认索引
扫描超时为2分钟。这可以在设置中进行调整。

An index scan is the process of looking for your query predicate in the index. E.g. if you have a field named "a" and an index on this field called "ix_a", the query "SELECT * FROM bucket where A = 123" would perform an index scan on the index ix_a to look for the value 123. As Gerald pointed out in a comment, the default index scan timeout is 2 minutes. This can be adjusted in the settings.

这个错误可能是由索引节点尺寸过小引起的,例如RAM不够,因此索引主要是从磁盘读取的,特别是如果索引字段非常大。或者服务器正忙。在4.1中。 0 COUNT(*)查询也执行索引扫描,因此它将有效地遍历整个主索引并计算所有项目。

This error can be caused by the index node being undersized, such as not enough RAM so the index is mostly read from disk, especially if the indexed field is very large. Or by the server being busy. In 4.1.0 a COUNT(*) query also performs an index scan, so it would effectively go over the entire primary index and count all items.

查询20米项目完全在Couchbase Server的功能,但您必须考虑正确设计索引以确保查询运行良好。

Querying 20m items is well within the capabilities of Couchbase Server, but you have to put some thought into designing your indexes correctly to ensure that the query will perform well.

这是一个非常通用的答案。如果您可以发布查询和查询执行计划,这将有所帮助。 (要获取执行计划,请在N1QL中运行以下命令: EXPLAIN< your query> 。)

This is a very generic answer. It would help if you could post both your query and the query execution plan. (To get the execution plan, run the following command in N1QL: EXPLAIN <your query>.)

这篇关于N1QL错误索引扫描超时 - 原因:索引扫描超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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