Couchbase execute query index scan timed out

82 Views Asked by At

I got the following exception when CouchbaseTemplate.findByN1QLProjection() was executed. Is there any way to increase the index scan timed out period?

Exception in thread "main" org.springframework.data.couchbase.core.CouchbaseQueryExecutionException: Unable to execute query due to the following errors:
{"msg":" Index scan timed out - cause: Index scan timed out","code":5000}
    at org.springframework.data.couchbase.core.CouchbaseTemplate.findByN1QLProjection(CouchbaseTemplate.java:498)
    ....
1

There are 1 best solutions below

0
Perry Krug On

The timeout is set to 2min by default and as a best practice, we really wouldn't recommend increasing it. The indexer has internal snapshots that get held open to ensure a correct response and so the longer that has to happen, the more resource usage there will be.

We would recommend tuning the query and indexes so that queries return much faster than 2min. If you do need longer running queries, that's what the Analytics Service is designed for.