I’m trying to build a covering index for the following query:
SELECT var.valueB FROM test AS a JOIN test AS b ON a.subId = b.subId
UNNEST a.valueA var
WHERE a.type = “TYPEA”
AND b.type = “TYPEB”
AND var.valueB = “testValueA”
I created the following indexes:
CREATE PRIMARY INDEX
subId, ALL (ARRAY
valueA END)) WHERE
type = “TYPEA”
but this will not use the index to cover the query. Any suggestions?
I had success with the same query without the JOIN (creating an index without ‘subId’), but it’s part of the requirement.
Is this possible in the current Couchbase (v6)?
Thank you for your time.