1
0
Fork 0

adding registration of the remove unnecessary remote scatter optimizer rule.

This commit is contained in:
James 2014-09-30 08:29:21 +01:00
parent d177bc110c
commit d204ce4019
4 changed files with 13 additions and 4 deletions

View File

@ -463,6 +463,11 @@ void Optimizer::setupRules () {
registerRule("distribute-sort-to-cluster",
distributeSortToCluster,
distributeSortToCluster_pass10,
false);*/
registerRule("remove-unnecessary-remote-scatter",
removeUnnecessaryRemoteScatter,
removeUnnecessaryRemoteScatter_pass10,
false);
}

View File

@ -145,7 +145,12 @@ namespace triagens {
// move SortNodes into the distribution.
// adjust gathernode to also contain the sort criterions.
distributeSortToCluster_pass10 = 1020
distributeSortToCluster_pass10 = 1020,
// try to get rid of a RemoteNode->ScatterNode combination which has
// only a SingletonNode and possibly some CalculationNodes as dependencies
removeUnnecessaryRemoteScatter_pass10 = 1030
};
public:

View File

@ -1905,6 +1905,7 @@ class ScatterToSingletonViaCalcOnlyFinder: public WalkerWorker<ExecutionNode> {
case EN::SCATTER:{
if (_scatter != nullptr) {
return true; // somehow found 2 scatter nodes . . .
// FIXME is this even possible?
}
_scatter = en;
return false; // continue . . .
@ -1915,7 +1916,7 @@ class ScatterToSingletonViaCalcOnlyFinder: public WalkerWorker<ExecutionNode> {
}
case EN::SINGLETON: {
if (_scatter == nullptr) {
return true; // found no scatter nodes
return true; // found no scatter nodes, abort
}
auto newPlan = _plan->clone();
if (newPlan == nullptr) {

View File

@ -116,8 +116,6 @@ namespace triagens {
int distributeSortToCluster (Optimizer*, ExecutionPlan*, Optimizer::Rule const*);
int distributeSortToCluster (Optimizer*, ExecutionPlan*, Optimizer::Rule const*);
////////////////////////////////////////////////////////////////////////////////
/// @brief try to get rid of a RemoteNode->ScatterNode combination which has
/// only a SingletonNode and possibly some CalculationNodes as dependencies