You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The FOR ... FILTER performs better than DOCUMENT().
See below:
Note
It is recommended to use subqueries with the FOR operation and filters over DOCUMENT() whenever the collections are known in advance, especially for joins, because they perform better, you can add additional filters, and combine it with sorting to get an array of documents in a guaranteed order.
Queries that use the DOCUMENT() function cannot be cached, each lookup is executed as a single operation, the lookups need to be executed on Coordinators for sharded collections in cluster deployments, and only primary indexes and no projections can be utilized.
The
FOR ... FILTERperforms better thanDOCUMENT().See below:
Note
It is recommended to use subqueries with the FOR operation and filters over DOCUMENT() whenever the collections are known in advance, especially for joins, because they perform better, you can add additional filters, and combine it with sorting to get an array of documents in a guaranteed order.
Queries that use the DOCUMENT() function cannot be cached, each lookup is executed as a single operation, the lookups need to be executed on Coordinators for sharded collections in cluster deployments, and only primary indexes and no projections can be utilized.
Source - https://docs.arangodb.com/3.11/aql/functions/miscellaneous/#document