mirror of https://gitee.com/bigwinds/arangodb
renamed optimizer rule for collect optimization
This commit is contained in:
parent
2b8cf7da62
commit
03c4a4fb23
|
@ -366,8 +366,9 @@ The following optimizer rules may appear in the `rules` attribute of a plan:
|
|||
performed because it may enable further optimizations by other rules.
|
||||
* `remove-sort-rand`: will appear when a *SORT RAND()* expression is removed by
|
||||
moving the random iteration into an *EnumerateCollectionNode*.
|
||||
* `remove-collect-into`: will appear if an *INTO* clause was removed from a *COLLECT*
|
||||
statement because the result of *INTO* is not used.
|
||||
* `remove-collect-variables`: 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.
|
||||
* `propagate-constant-attributes`: will appear when a constant value was inserted
|
||||
into a filter condition, replacing a dynamic attribute value.
|
||||
* `replace-or-with-in`: will appear if multiple *OR*-combined equality conditions
|
||||
|
|
|
@ -645,7 +645,7 @@ SHELL_SERVER_AQL = @top_srcdir@/js/server/tests/aql-arithmetic.js \
|
|||
@top_srcdir@/js/server/tests/aql-optimizer-rule-move-calculations-down.js \
|
||||
@top_srcdir@/js/server/tests/aql-optimizer-rule-move-calculations-up.js \
|
||||
@top_srcdir@/js/server/tests/aql-optimizer-rule-move-filters-up.js \
|
||||
@top_srcdir@/js/server/tests/aql-optimizer-rule-remove-collect-into.js \
|
||||
@top_srcdir@/js/server/tests/aql-optimizer-rule-remove-collect-variables.js \
|
||||
@top_srcdir@/js/server/tests/aql-optimizer-rule-remove-filter-covered-by-index.js \
|
||||
@top_srcdir@/js/server/tests/aql-optimizer-rule-remove-redundant-calculations.js \
|
||||
@top_srcdir@/js/server/tests/aql-optimizer-rule-remove-redundant-or.js \
|
||||
|
|
|
@ -478,9 +478,9 @@ void Optimizer::setupRules() {
|
|||
registerRule("remove-sort-rand", removeSortRandRule, removeSortRandRule_pass5,
|
||||
true);
|
||||
|
||||
// remove INTO from COLLECT
|
||||
registerRule("remove-collect-into", removeCollectIntoRule,
|
||||
removeCollectIntoRule_pass5, true);
|
||||
// remove unused INTO variable from COLLECT, or unused aggregates
|
||||
registerRule("remove-collect-variables", removeCollectVariablesRule,
|
||||
removeCollectVariablesRule_pass5, true);
|
||||
|
||||
// remove unused out variables for data-modification queries
|
||||
registerRule("remove-data-modification-out-variables",
|
||||
|
|
|
@ -165,7 +165,7 @@ class Optimizer {
|
|||
removeSortRandRule_pass5 = 720,
|
||||
|
||||
// remove INTO for COLLECT if appropriate
|
||||
removeCollectIntoRule_pass5 = 740,
|
||||
removeCollectVariablesRule_pass5 = 740,
|
||||
|
||||
// propagate constant attributes in FILTERs
|
||||
propagateConstantAttributesRule_pass5 = 750,
|
||||
|
|
|
@ -438,8 +438,8 @@ void triagens::aql::removeUnnecessaryFiltersRule(Optimizer* opt,
|
|||
/// additionally remove all unused aggregate calculations from a COLLECT
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void triagens::aql::removeCollectIntoRule(Optimizer* opt, ExecutionPlan* plan,
|
||||
Optimizer::Rule const* rule) {
|
||||
void triagens::aql::removeCollectVariablesRule(Optimizer* opt, ExecutionPlan* plan,
|
||||
Optimizer::Rule const* rule) {
|
||||
bool modified = false;
|
||||
std::vector<ExecutionNode*> nodes(plan->findNodesOfType(EN::COLLECT, true));
|
||||
|
||||
|
|
|
@ -58,10 +58,10 @@ void removeUnnecessaryFiltersRule(Optimizer*, ExecutionPlan*,
|
|||
Optimizer::Rule const*);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief remove INTO of a COLLECT if not used
|
||||
/// @brief remove unused INTO variable from COLLECT, or unused aggregates
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
void removeCollectIntoRule(Optimizer*, ExecutionPlan*, Optimizer::Rule const*);
|
||||
void removeCollectVariablesRule(Optimizer*, ExecutionPlan*, Optimizer::Rule const*);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
/// @brief propagate constant attributes in FILTERs
|
||||
|
|
|
@ -37,7 +37,7 @@ var isEqual = helper.isEqual;
|
|||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
function optimizerRuleTestSuite () {
|
||||
var ruleName = "remove-collect-into";
|
||||
var ruleName = "remove-collect-variables";
|
||||
// various choices to control the optimizer:
|
||||
var paramNone = { optimizer: { rules: [ "-all" ] } };
|
||||
var paramEnabled = { optimizer: { rules: [ "-all", "+" + ruleName ] } };
|
Loading…
Reference in New Issue