Couchbase versions performance differences


Noticed interesting bug about couchbase@4.0.0. On couchbase@3.2.4 version query (dbCluster.query()):

SELECT IFMISSINGORNULL( SUM(t1.quantity) / COUNT(DISTINCT t1.transactionId), 0) as amount
FROM production t1
WHERE t1._class = "com.TransactionItem" 
  AND t1.originalSource = "S1"
  AND t1.brandCode = "BC1"
  AND t1.consultantId IN [111, 112, 113, 114, 115, 116, 117]
  AND t1.timestamp BETWEEN "2021-06-27T00:00:00Z" AND "2022-06-25T23:59:59Z"
  AND (t1.status IS MISSING OR LOWER(t1.status) != "deleted")
  AND t1.unitPrice != "0"

took about 0.8 second, but when upgraded to version @4.0.0 it started to take 20 secs!

Who knows why it takes so much on new version?

Using Couchbase Enterprise Edition 6.6.3 build 9808.
DB has 170,655,089 items, 104GB / 126GB RAM, 541GB HDD. (1 bucket, 6 servers (2 for data, 4 for query and index)).

Thanks in advance!

Hey @Vladlan,

That’s quite the significant difference. Would you be able to run your test with the core logging turned up all the way? You can do this by setting an environment variable before running the test:

CBPPLOGLEVEL=trace node test.js

Cheers, Brett

@brett19 could you please provide link to CBPPLOGLEVEL documentation? Or what should I see after setting CBPPLOGLEVEL to true?

Hey @Vladlan ,

Turning on CBPPLOGLEVEL should lead to a large amount of logging being produced by the SDK. This logging should help us identify the underlying problem and where the client is spending its time.

Cheers, Brett