N1ql QUERY performance impacted after upgrading to new CouchBase JDK 2.5.8

n1ql

#1

Hi Team,

Need your help on improving performance of N1ql.
which got impacted highly after I started using the 2.5.8 sdk.
Execuing N1ql thru Java after connecting to my bucket as below.
Connection to Couch:

Cluster cluster = CouchbaseCluster
.create(“xx.xxx:8091”);
Bucket secureBucket = cluster.openBucket(“userid”, “password”);
Exeuciton of N1ql:

String placeholders = “placeholders”;
JsonObject placeholder = JsonObject.create().put(“placeholders”,
placeholders);
String statement1 = “select a.* from ace_supplier a where a.type = $placeholders”;
N1qlQuery querytoextractplaceholders = N1qlQuery.parameterized(
statement1, placeholder);
placeholderslist = secureBucket.query(querytoextractplaceholders);

Latest Maven dependecy:-

com.couchbase.client java-client 2.5.8

#2

Hi @naganjaneyulu.yazali, can you provide more details about the impact on N1QL queries? Are they running more slowly? To what degree? How complex is your query? How big is your data?


#3

Simple fecth queries … earlier is used to take 500 ms… now it is taking 2 to 4 seconds …
data also not much big… it’s just around 50 to 100k.


#4

Can you try running your query via the REST API to see how it compares? E.g.:

curl -X POST -u Administrator:password -d 'statement=select count(*) from travel-sample' http://localhost:9093/query/service