Description
Consider the following query which executes using an index:
SELECT modelID FROM `default`
WHERE ANY v IN modelTypeID
SATISFIES (v.brandID = 1 OR v.brandID = 2 or v.brandID = 3) END
Index definition:
CREATE INDEX `modelID` ON `default`(DISTINCT (ARRAY `v` FOR `v` IN `modelTypeIDs` END))
This simplified version of the query will also execute, but it will not use anything other than a primary index:
SELECT modelID FROM `default`
WHERE ANY v IN modelTypeID
SATISFIES (v.brandID IN [1,2,3]) END
After a discussion with Marco Greco, he suggested a convenience improvement could be supporting unwinding automatically so the optimizer utilizes an index.