Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Add details about the remove-sort-rand-limit-1 optimizer rule #1285

Merged
merged 2 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions 3.10/aql/execution-and-performance-optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -612,6 +612,11 @@ The following optimizer rules may appear in the `rules` attribute of a plan:
Appears when a `SORT RAND() LIMIT 1` construct is removed by moving the
random iteration into an `EnumerateCollectionNode`.

The RocksDB storage engine doesn't allow to seek random documents efficiently.
This optimization picks a pseudo-random document based on a limited number of
seeks within the collection's key range, selecting a random start key in the
key range, and then going a few steps before or after that.

- `remove-unnecessary-calculations`:
Appears if `CalculationNode`s are removed from the query. The rule
removes all calculations whose result is not referenced in the query (note
Expand Down
5 changes: 5 additions & 0 deletions 3.11/aql/execution-and-performance-optimizer.md
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,11 @@ The following optimizer rules may appear in the `rules` attribute of a plan:
- `remove-sort-rand-limit-1`:
Appears when a `SORT RAND() LIMIT 1` construct is removed by moving the
random iteration into an `EnumerateCollectionNode`.

The RocksDB storage engine doesn't allow to seek random documents efficiently.
This optimization picks a pseudo-random document based on a limited number of
seeks within the collection's key range, selecting a random start key in the
key range, and then going a few steps before or after that.

- `remove-unnecessary-calculations`:
Appears if `CalculationNode`s are removed from the query. The rule
Expand Down