Details
-
Bug
-
Resolution: Resolved
-
Major
-
4.6.1
-
None
-
Untriaged
-
No
Description
When this query is used, couchbase is performing full data scan (index is not used)
var query = n1qlQuery.fromString("SELECT LOWER(e1.color) as color, e2.* FROM xxx e1 JOIN xxx e2 ON KEYS e1.person_id WHERE e1.type = $1 AND e1.person_id = $2"); bucket.query(query, ["alert", personId], function(err, person) {} )
But when query is structured in this way, index is used
var query = n1qlQuery.fromString("SELECT LOWER(e1.color) as color, e2.* FROM xxx e1 JOIN xxx e2 ON KEYS e1.person_id WHERE e1.type =\"alert\" AND e1.person_id = \""personId"\"");
bucket.query(query, function(err, person) {} )