Slow query for data which returns 0 or near 0

Hey all I am trying to understand why a certain query is performing slow.

I am running a slighlty longer query but will give the basic format

Select t.outer.inner
from bucket t
where account in [“a”, “b”, “c”]
AND t.outer.inner.val IS NOT MISSING

(the query is a little bit longer but this is what is occurring at the basis. I can provide the larger query if need be )

We have about 650k records in the DB, the combo of accounts in the query account for about 1/3 of the data. The plan shows that it is taking a significant portion of that time in the index gathering.

And the main point is this query for that given field is close to 0 in terms of results returned so not sure why the index search is taking longer.

The query in the console returns in about 2.5 seconds and the query under a stress test runs in about 11 seconds.

Any ideas or suggestions would be great.

what is your index. how many elements in IN array.

Checkout https://blog.couchbase.com/in-list-handling-improvements-in-couchbase-server-6-5/