Skip to content

AQL :: Replace DOCUMENT() with FOR ... FILTER #1433

@wajda

Description

@wajda

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.

Source - https://docs.arangodb.com/3.11/aql/functions/miscellaneous/#document

Metadata

Metadata

Assignees

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions