1
0
Fork 0

only do not use geoindex in inner loop if we want to sort

This commit is contained in:
Jan Christoph Uhde 2016-12-19 10:52:42 +01:00
parent 32e1c7eac4
commit 004da0c614
2 changed files with 7 additions and 9 deletions

View File

@ -4343,7 +4343,7 @@ void replaceGeoCondition(ExecutionPlan* plan, GeoIndexInfo& info){
auto ast = plan->getAst(); auto ast = plan->getAst();
CalculationNode* newNode = nullptr; CalculationNode* newNode = nullptr;
Expression* expr = new Expression(ast, static_cast<CalculationNode*>(info.setter)->expression()->nodeForModification()->clone(ast)); Expression* expr = new Expression(ast, static_cast<CalculationNode*>(info.setter)->expression()->nodeForModification()->clone(ast));
try { try {
newNode = new CalculationNode(plan, plan->nextId(), expr, static_cast<CalculationNode*>(info.setter)->outVariable()); newNode = new CalculationNode(plan, plan->nextId(), expr, static_cast<CalculationNode*>(info.setter)->outVariable());
} catch (...) { } catch (...) {
@ -4353,7 +4353,7 @@ void replaceGeoCondition(ExecutionPlan* plan, GeoIndexInfo& info){
plan->registerNode(newNode); plan->registerNode(newNode);
plan->replaceNode(info.setter, newNode); plan->replaceNode(info.setter, newNode);
auto replaceInfo = iterativePreorderWithCondition(EN::FILTER, newNode->expression()->nodeForModification(), &isGeoFilterExpression); auto replaceInfo = iterativePreorderWithCondition(EN::FILTER, newNode->expression()->nodeForModification(), &isGeoFilterExpression);
auto replacement = ast->createNodeValueBool(true); auto replacement = ast->createNodeValueBool(true);
@ -4381,10 +4381,11 @@ bool applyGeoOptimization(bool near, ExecutionPlan* plan, GeoIndexInfo& first, G
} }
// We are not allowed to be a inner loop // We are not allowed to be a inner loop
if(first.collectionNode->isInInnerLoop()){ if(first.collectionNode->isInInnerLoop() && first.executionNodeType == EN::SORT){
return false; return false;
} }
LOG_TOPIC(DEBUG, Logger::DEVEL) << "NO INNER LOOP";
// //LOG_TOPIC(DEBUG, Logger::DEVEL) << " attributes: " << res.longitude[0] // //LOG_TOPIC(DEBUG, Logger::DEVEL) << " attributes: " << res.longitude[0]
// // << ", " << res.longitude // // << ", " << res.longitude
// // << " of collection:" << res.collectionNode->collection()->getName() // // << " of collection:" << res.collectionNode->collection()->getName()
@ -4515,11 +4516,8 @@ void arangodb::aql::geoIndexRule(Optimizer* opt,
} }
} }
//if (modified){
// opt->addPlan(newPlan, rule, modified); opt->addPlan(plan, rule, modified);
//} else {
opt->addPlan(plan, rule, modified);
//}
LOG_TOPIC(DEBUG, Logger::DEVEL) << "EXIT GEO RULE - modified: " << modified; LOG_TOPIC(DEBUG, Logger::DEVEL) << "EXIT GEO RULE - modified: " << modified;
//LOG_TOPIC(DEBUG, Logger::DEVEL) << ""; //LOG_TOPIC(DEBUG, Logger::DEVEL) << "";

View File

@ -209,7 +209,7 @@ function optimizerRuleTestSuite() {
, cluster : false , cluster : false
, sort : false , sort : false
, filter : true , filter : true
, index : false , index : true
}, },
]; ];