1
0
Fork 0

renamed optimizer rule for collect optimization

This commit is contained in:
jsteemann 2016-01-17 00:07:13 +01:00
parent 2b8cf7da62
commit 03c4a4fb23
7 changed files with 13 additions and 12 deletions

View File

@ -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

View File

@ -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 \

View File

@ -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",

View File

@ -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,

View File

@ -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));

View File

@ -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

View File

@ -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 ] } };