Details
-
Bug
-
Resolution: Fixed
-
Major
-
4.6.2, 5.0.0
-
4.6.2-3889
-
Untriaged
-
Yes
Description
Found this issue while verifying:
https://issues.couchbase.com/browse/MB-22757
Index created:
CREATE INDEX idx ON default( DISTINCT ARRAY v FOR v in join_yr END)
Query issued:
EXPLAIN select meta().id from default where any v in join_yr satisfies v = 2016 END and (ANY v IN default.join_yr SATISFIES v = 2014 END)
This query uses the right index and is a covered query as expected in MB-22757.
But it gives different results than the same query using primary index.
select meta().id from default where any v in join_yr satisfies v = 2016 END and (ANY v IN default.join_yr SATISFIES v = 2014 END) order by meta().id limit 2
gives different results than
select meta().id from default use index (`#primary`) where any v in join_yr satisfies v = 2016 END and (ANY v IN default.join_yr SATISFIES v = 2014 END) order by meta().id limit 2