Enum rincon_client::aql::types::OptimizerRule [] [src]

pub enum OptimizerRule {
    All,
    MoveCalculationsUp,
    MoveFiltersUp,
    SortInValues,
    RemoveUnnecessaryFilters,
    RemoveRedundantCalculations,
    RemoveUnnecessaryCalculations,
    RemoveRedundantSorts,
    InterchangeAdjacentEnumerations,
    RemoveCollectVariables,
    PropagateConstantAttributes,
    ReplaceOrWithIn,
    RemoveRedundantOr,
    UseIndexes,
    RemoveFilterCoveredByIndex,
    RemoveFilterCoveredByTraversal,
    UseIndexForSort,
    MoveCalculationsDown,
    PatchUpdateStatements,
    OptimizeTraversals,
    InlineSubQueries,
    GeoIndexOptimizer,
    RemoveSortRand,
    ReduceExtractionToProjection,
    DistributeInCluster,
    ScatterInCluster,
    DistributeFilterCalcToCluster,
    DistributeSortToCluster,
    RemoveUnnecessaryRemoteScatter,
    UnDistributeRemoveAfterEnumColl,
    Custom(String),
}

Represents the rules for the AQL query optimizer.

This enum defines all possible optimizer rules as listed in the official documentation of ArangoDB.

Source: https://docs.arangodb.com/devel/AQL/ExecutionAndPerformance/Optimizer.html#list-of-optimizer-rules

Last updated: 10/08/2017

Variants

Pseudo-rule that matches all rules.

will appear if a CalculationNode was moved up in a plan. The intention of this rule is to move calculations up in the processing pipeline as far as possible (ideally out of enumerations) so they are not executed in loops if not required. It is also quite common that this rule enables further optimizations to kick in.

will appear if a FilterNode was moved up in a plan. The intention of this rule is to move filters up in the processing pipeline as far as possible (ideally out of inner loops) so they filter results as early as possible.

will appear when the values used as right-hand side of an IN operator will be pre-sorted using an extra function call. Pre-sorting the comparison array allows using a binary search in-list lookup with a logarithmic complexity instead of the default linear complexity in-list lookup.

will appear if a FilterNode was removed or replaced. FilterNodes whose filter condition will always evaluate to true will be removed from the plan, whereas FilterNode that will never let any results pass will be replaced with a NoResultsNode.

will appear if redundant calculations (expressions with the exact same result) were found in the query. The optimizer rule will then replace references to the redundant expressions with a single reference, allowing other optimizer rules to remove the then-unneeded CalculationNodes.

will appear if CalculationNodes were removed from the query. The rule will removed all calculations whose result is not referenced in the query (note that this may be a consequence of applying other optimizations).

will appear if multiple SORT statements can be merged into fewer sorts.

will appear if a query contains multiple FOR statements whose order were permuted. Permutation of FOR statements is performed because it may enable further optimizations by other rules.

will appear if an INTO clause was removed from a COLLECT statement because the result of INTO is not used. May also appear if a result of a COLLECT statement's AGGREGATE variables is not used.

will appear when a constant value was inserted into a filter condition, replacing a dynamic attribute value.

will appear if multiple OR-combined equality conditions on the same variable or attribute were replaced with an IN condition.

will appear if multiple OR conditions for the same variable or attribute were combined into a single condition.

will appear when an index is used to iterate over a collection. As a consequence, an EnumerateCollectionNode was replaced with an IndexNode in the plan.

will appear if a FilterNode was removed or replaced because the filter condition is already covered by an IndexNode.

will appear if a FilterNode was removed or replaced because the filter condition is already covered by an TraversalNode.

will appear if an index can be used to avoid a SORT operation. If the rule was applied, a SortNode was removed from the plan.

will appear if a CalculationNode was moved down in a plan. The intention of this rule is to move calculations down in the processing pipeline as far as possible (below FILTER, LIMIT and SUBQUERY nodes) so they are executed as late as possible and not before their results are required.

will appear if an UpdateNode was patched to not buffer its input completely, but to process it in smaller batches. The rule will fire for an UPDATE query that is fed by a full collection scan, and that does not use any other indexes and sub-queries.

will appear if either the edge or path output variable in an AQL traversal was optimized away, or if a FILTER condition from the query was moved in the TraversalNode for early pruning of results.

will appear when a sub query was pulled out in its surrounding scope, e.g. FOR x IN (FOR y IN collection FILTER y.value >= 5 RETURN y.test) RETURN x.a would become FOR tmp IN collection FILTER tmp.value >= 5 LET x = tmp.test RETURN x.a

will appear when a geo index is utilized.

will appear when a SORT RAND() expression is removed by moving the random iteration into an EnumerateCollectionNode. This optimizer rule is specific for the MMFiles storage engine.

will appear when an EnumerationCollectionNode that would have extracted an entire document was modified to return only a projection of each document. This optimizer rule is specific for the RocksDB storage engine.

will appear when query parts get distributed in a cluster. This is not an optimization rule, and it cannot be turned off.

will appear when scatter, gather, and remote nodes are inserted into a distributed query. This is not an optimization rule, and it cannot be turned off.

will appear when filters are moved up in a distributed execution plan. Filters are moved as far up in the plan as possible to make result sets as small as possible as early as possible.

will appear if sorts are moved up in a distributed query. Sorts are moved as far up in the plan as possible to make result sets as small as possible as early as possible.

will appear if a RemoteNode is followed by a ScatterNode, and the ScatterNode is only followed by calculations or the SingletonNode. In this case, there is no need to distribute the calculation, and it will be handled centrally.

will appear if a RemoveNode can be pushed into the same query part that enumerates over the documents of a collection. This saves inter-cluster round-trips between the EnumerateCollectionNode and the RemoveNode.

Can be used to specify a rule that has not been added to this enum yet.

Methods

impl OptimizerRule
[src]

[src]

Constructs an optimizer rule from the string slice as used in the ArangoDB API.

[src]

Returns this optimizer rule as a string slice to be used with the ArangoDB API.

Trait Implementations

impl Debug for OptimizerRule
[src]

[src]

Formats the value using the given formatter. Read more

impl Clone for OptimizerRule
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl PartialEq for OptimizerRule
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl Eq for OptimizerRule
[src]

impl Hash for OptimizerRule
[src]

[src]

Feeds this value into the given [Hasher]. Read more

1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

Auto Trait Implementations

impl Send for OptimizerRule

impl Sync for OptimizerRule