I’ve noticed countless examples on the web showing the creation of indexes on arrays. Almost all examples use the “DISTINCT ARRAY” syntax at the beginning of the definition:
CREATE INDEX isched ON `travel-sample`(DISTINCT ARRAY i.flight FOR i IN schedule END, schedule) WHERE (type = "route") AND (array_length(schedule) < 10);
What is the behavior between ALL and DISTINCT when it comes to indexing? I have scoured the documentation, but there is no clear explanation. I have tried both ALL and DISTINCT and neither seem to affect results or query time.