Not able to avoid bucket scan while using covered array index

Document schema looks like below

  "count": 3,
  "member_id": "member_0_2",
  "segments": ["segment_0", "segment_1", "segment_2"]

Covered array index that:

CREATE INDEX `segments_idx` ON `sample`(`member_id`,(distinct (array (`segment`) for `segment` in `segments` end))) WHERE (`count` > 0)

Query that we are firing:

SELECT count(*) FROM sample
WHERE count > 0 AND member_id LIKE "member_%"
AND ANY segment IN segments SATISFIES segment LIKE "segment_0" END;

Looking at the query plan:

Query plan JSON dump:

How can I avoid bucket scan from above query?

Got is resolved by following Index is not covered when array is used in where clause - Couchbase 4.5

Great to hear from you @abhishek :slight_smile:

Sure Jeelan :slight_smile: This was related to a project, where Couchbase was being evaluated as one of the possible alternatives to replace Postgres + Redis cluster set up

Hope CB comes up on top on your evaluations. You know the stuff, still let us know if we can help in anyway.