Description
The following scenario should push down the ORDER BY to the index.
CREATE INDEX idx_age ON default(age, DISTINCT ARRAY name FOR name IN names END, names );
EXPLAIN SELECT META().id
FROM default
WHERE age IS NOT NULL AND ANY name IN names SATISFIES name LIKE 'test%' END
ORDER BY age
LIMIT 30 OFFSET 0;
This was raised by a user as a high priority:
https://forums.couchbase.com/t/couchbase-4-5-indexscancounter-missing-for-array-indexing/8139/5
Attachments
For Gerrit Dashboard: MB-19631 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
64060,2 | Fix MB-19631. Push down ORDER BY to index when the array index term is not part of the ORDER BY. | master | query | Status: MERGED | +2 | +1 |