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
All
Pseudo-rule that matches all rules.
MoveCalculationsUp
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.
MoveFiltersUp
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.
SortInValues
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.
RemoveUnnecessaryFilters
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.
RemoveRedundantCalculations
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.
RemoveUnnecessaryCalculations
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).
RemoveRedundantSorts
will appear if multiple SORT statements can be merged into fewer sorts.
InterchangeAdjacentEnumerations
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.
RemoveCollectVariables
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.
PropagateConstantAttributes
will appear when a constant value was inserted into a filter condition, replacing a dynamic attribute value.
ReplaceOrWithIn
will appear if multiple OR-combined equality conditions on the same variable or attribute were replaced with an IN condition.
RemoveRedundantOr
will appear if multiple OR conditions for the same variable or attribute were combined into a single condition.
UseIndexes
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.
RemoveFilterCoveredByIndex
will appear if a FilterNode was removed or replaced because the filter condition is already covered by an IndexNode.
RemoveFilterCoveredByTraversal
will appear if a FilterNode was removed or replaced because the filter condition is already covered by an TraversalNode.
UseIndexForSort
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.
MoveCalculationsDown
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.
PatchUpdateStatements
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.
OptimizeTraversals
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.
InlineSubQueries
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
GeoIndexOptimizer
will appear when a geo index is utilized.
RemoveSortRand
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.
ReduceExtractionToProjection
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.
DistributeInCluster
will appear when query parts get distributed in a cluster. This is not an optimization rule, and it cannot be turned off.
ScatterInCluster
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.
DistributeFilterCalcToCluster
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.
DistributeSortToCluster
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.
RemoveUnnecessaryRemoteScatter
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.
UnDistributeRemoveAfterEnumColl
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.
Custom(String)
Can be used to specify a rule that has not been added to this enum yet.
Methods
impl OptimizerRule
[src]
pub fn from_api_str(api_str: &str) -> Self
[src]
Constructs an optimizer rule from the string slice as used in the ArangoDB API.
pub fn as_api_str(&self) -> &str
[src]
Returns this optimizer rule as a string slice to be used with the ArangoDB API.
Trait Implementations
impl Debug for OptimizerRule
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for OptimizerRule
[src]
fn clone(&self) -> OptimizerRule
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for OptimizerRule
[src]
fn eq(&self, __arg_0: &OptimizerRule) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &OptimizerRule) -> bool
[src]
This method tests for !=
.