mirror of https://gitee.com/bigwinds/arangodb
Merge branch 'aql2' of https://github.com/triAGENS/ArangoDB into aql2
This commit is contained in:
commit
d57ed2749a
|
@ -101,12 +101,7 @@ int Optimizer::createPlans (ExecutionPlan* plan,
|
|||
|
||||
_newPlans.clear();
|
||||
|
||||
// int pass = 1;
|
||||
while (leastDoneLevel < maxRuleLevel) {
|
||||
/*
|
||||
std::cout << "Entering pass " << pass << " of query optimization..."
|
||||
<< std::endl;
|
||||
*/
|
||||
// Find variable usage for all old plans now:
|
||||
for (auto p : _plans.list) {
|
||||
if (! p->varUsageComputed()) {
|
||||
|
|
|
@ -377,7 +377,7 @@ class FilterToEnumCollFinder : public WalkerWorker<ExecutionNode> {
|
|||
RangesInfo* _ranges;
|
||||
Optimizer* _opt;
|
||||
ExecutionPlan* _plan;
|
||||
Variable const* _var;
|
||||
std::unordered_set<VariableId> _varIds;
|
||||
bool _canThrow;
|
||||
int _level;
|
||||
|
||||
|
@ -386,9 +386,9 @@ class FilterToEnumCollFinder : public WalkerWorker<ExecutionNode> {
|
|||
FilterToEnumCollFinder (Optimizer* opt, ExecutionPlan* plan, Variable const* var)
|
||||
: _opt(opt),
|
||||
_plan(plan),
|
||||
_var(var),
|
||||
_canThrow(false) {
|
||||
_ranges = new RangesInfo();
|
||||
_varIds.insert(var->id);
|
||||
};
|
||||
|
||||
~FilterToEnumCollFinder () {
|
||||
|
@ -398,10 +398,15 @@ class FilterToEnumCollFinder : public WalkerWorker<ExecutionNode> {
|
|||
bool before (ExecutionNode* en) {
|
||||
_canThrow = (_canThrow || en->canThrow()); // can any node walked over throw?
|
||||
|
||||
if (en->getType() == triagens::aql::ExecutionNode::CALCULATION) {
|
||||
if (en->getType() == triagens::aql::ExecutionNode::FILTER) {
|
||||
std::vector<Variable const*> inVar = en->getVariablesUsedHere();
|
||||
TRI_ASSERT(inVar.size() == 1);
|
||||
_varIds.insert(inVar[0]->id);
|
||||
}
|
||||
else if (en->getType() == triagens::aql::ExecutionNode::CALCULATION) {
|
||||
auto outvar = en->getVariablesSetHere();
|
||||
TRI_ASSERT(outvar.size() == 1);
|
||||
if (outvar[0]->id == _var->id) {
|
||||
if (_varIds.find(outvar[0]->id) != _varIds.end()) {
|
||||
auto node = static_cast<CalculationNode*>(en);
|
||||
std::string attr;
|
||||
std::string enumCollVar;
|
||||
|
|
Loading…
Reference in New Issue