I am having some performance issues when executing N1Q1 queries using the Java SDK (v 2.7.10).
The total number of documents in the bucket is approx. 50k.
When executing the queries in the workbench the elapsed time is 1-2 s . However, from the Java SDK, it takes 4 - 5s.
Any help ?
The query uses the IN clause with primary index but with static values . Like this,
select* from bucketname as item where meta().id LIKE βuser::%β and item.userid IN [β1β, β2β, β3β, β4β, β5β, β6β, β7β, β8β, β9β, β10β, β11β, β12β, β13β]
and (item.firstname LIKE β$searchβ OR item.lastname LIKE $search) OFFSET $offset LIMIT $limit ;
Are there any better approaches using some indexing to improve the response time?
If you have already have document keys, USE KEYS better.
You should checkout above link.
Avoid primary index (http://index-advisor.couchbase.com/). If you have to use IN clause with query parameters use adhoc=true