mirror of https://gitee.com/bigwinds/arangodb
Rename staticAnalysis -> planRegisters.
This commit is contained in:
parent
5b0b1f0af5
commit
be07d39457
|
@ -1489,7 +1489,7 @@ int EnumerateListBlock::initialize () {
|
||||||
auto en = reinterpret_cast<EnumerateListNode const*>(_exeNode);
|
auto en = reinterpret_cast<EnumerateListNode const*>(_exeNode);
|
||||||
|
|
||||||
// get the inVariable register id . . .
|
// get the inVariable register id . . .
|
||||||
// staticAnalysis has been run, so getPlanNode()->_varOverview is set up
|
// planRegisters() has been run, so getPlanNode()->_varOverview is set up
|
||||||
auto it = getPlanNode()->getVarOverview()->varInfo.find(en->_inVariable->id);
|
auto it = getPlanNode()->getVarOverview()->varInfo.find(en->_inVariable->id);
|
||||||
|
|
||||||
if (it == getPlanNode()->getVarOverview()->varInfo.end()){
|
if (it == getPlanNode()->getVarOverview()->varInfo.end()){
|
||||||
|
@ -1765,7 +1765,8 @@ int CalculationBlock::initialize () {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We know that staticAnalysis has been run, so getPlanNode()->_varOverview is set up
|
// We know that planRegisters has been run, so
|
||||||
|
// getPlanNode()->_varOverview is set up
|
||||||
auto en = static_cast<CalculationNode const*>(getPlanNode());
|
auto en = static_cast<CalculationNode const*>(getPlanNode());
|
||||||
|
|
||||||
std::unordered_set<Variable*> inVars = _expression->variables();
|
std::unordered_set<Variable*> inVars = _expression->variables();
|
||||||
|
@ -1867,7 +1868,8 @@ int SubqueryBlock::initialize () {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We know that staticAnalysis has been run, so getPlanNode()->_varOverview is set up
|
// We know that planRegisters() has been run, so
|
||||||
|
// getPlanNode()->_varOverview is set up
|
||||||
|
|
||||||
auto en = static_cast<SubqueryNode const*>(getPlanNode());
|
auto en = static_cast<SubqueryNode const*>(getPlanNode());
|
||||||
|
|
||||||
|
@ -1930,7 +1932,8 @@ int FilterBlock::initialize () {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
// We know that staticAnalysis has been run, so getPlanNode()->_varOverview is set up
|
// We know that planRegisters() has been run, so
|
||||||
|
// getPlanNode()->_varOverview is set up
|
||||||
|
|
||||||
auto en = static_cast<FilterNode const*>(getPlanNode());
|
auto en = static_cast<FilterNode const*>(getPlanNode());
|
||||||
|
|
||||||
|
@ -2117,7 +2120,8 @@ int AggregateBlock::initialize () {
|
||||||
_variableNames.clear();
|
_variableNames.clear();
|
||||||
|
|
||||||
for (auto p : en->_aggregateVariables){
|
for (auto p : en->_aggregateVariables){
|
||||||
// We know that staticAnalysis has been run, so getPlanNode()->_varOverview is set up
|
// We know that planRegisters() has been run, so
|
||||||
|
// getPlanNode()->_varOverview is set up
|
||||||
auto itOut = en->getVarOverview()->varInfo.find(p.first->id);
|
auto itOut = en->getVarOverview()->varInfo.find(p.first->id);
|
||||||
TRI_ASSERT(itOut != en->getVarOverview()->varInfo.end());
|
TRI_ASSERT(itOut != en->getVarOverview()->varInfo.end());
|
||||||
|
|
||||||
|
@ -2349,8 +2353,9 @@ int SortBlock::initialize () {
|
||||||
|
|
||||||
_sortRegisters.clear();
|
_sortRegisters.clear();
|
||||||
|
|
||||||
for( auto p: en->_elements){
|
for (auto p: en->_elements){
|
||||||
// We know that staticAnalysis has been run, so getPlanNode()->_varOverview is set up
|
// We know that planRegisters() has been run, so
|
||||||
|
// getPlanNode()->_varOverview is set up
|
||||||
auto it = en->getVarOverview()->varInfo.find(p.first->id);
|
auto it = en->getVarOverview()->varInfo.find(p.first->id);
|
||||||
TRI_ASSERT(it != en->getVarOverview()->varInfo.end());
|
TRI_ASSERT(it != en->getVarOverview()->varInfo.end());
|
||||||
_sortRegisters.push_back(make_pair(it->second.registerId, p.second));
|
_sortRegisters.push_back(make_pair(it->second.registerId, p.second));
|
||||||
|
@ -3233,7 +3238,8 @@ int GatherBlock::initialize () {
|
||||||
_sortRegisters.clear();
|
_sortRegisters.clear();
|
||||||
|
|
||||||
for( auto p: en->_elements){
|
for( auto p: en->_elements){
|
||||||
// We know that staticAnalysis has been run, so getPlanNode()->_varOverview is set up
|
// We know that planRegisters has been run, so
|
||||||
|
// getPlanNode()->_varOverview is set up
|
||||||
auto it = en->getVarOverview()->varInfo.find(p.first->id);
|
auto it = en->getVarOverview()->varInfo.find(p.first->id);
|
||||||
TRI_ASSERT(it != en->getVarOverview()->varInfo.end());
|
TRI_ASSERT(it != en->getVarOverview()->varInfo.end());
|
||||||
_sortRegisters.push_back(make_pair(it->second.registerId, p.second));
|
_sortRegisters.push_back(make_pair(it->second.registerId, p.second));
|
||||||
|
|
|
@ -461,7 +461,7 @@ std::cout << "REGISTERING QUERY ON COORDINATOR WITH ID: " << id << "\n";
|
||||||
collection->setCurrentShard(shardId);
|
collection->setCurrentShard(shardId);
|
||||||
|
|
||||||
plan.findVarUsage();
|
plan.findVarUsage();
|
||||||
plan.staticAnalysis();
|
plan.planRegisters();
|
||||||
|
|
||||||
// create a JSON representation of the plan
|
// create a JSON representation of the plan
|
||||||
triagens::basics::Json result(triagens::basics::Json::Array);
|
triagens::basics::Json result(triagens::basics::Json::Array);
|
||||||
|
@ -693,7 +693,7 @@ ExecutionEngine* ExecutionEngine::instanciateFromPlan (QueryRegistry* queryRegis
|
||||||
if (! plan->varUsageComputed()) {
|
if (! plan->varUsageComputed()) {
|
||||||
plan->findVarUsage();
|
plan->findVarUsage();
|
||||||
}
|
}
|
||||||
plan->staticAnalysis();
|
plan->planRegisters();
|
||||||
|
|
||||||
ExecutionBlock* root = nullptr;
|
ExecutionBlock* root = nullptr;
|
||||||
|
|
||||||
|
|
|
@ -571,10 +571,10 @@ struct StaticAnalysisDebugger : public WalkerWorker<ExecutionNode> {
|
||||||
};
|
};
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief staticAnalysis
|
/// @brief planRegisters
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void ExecutionNode::staticAnalysis (ExecutionNode* super) {
|
void ExecutionNode::planRegisters (ExecutionNode* super) {
|
||||||
// The super is only for the case of subqueries.
|
// The super is only for the case of subqueries.
|
||||||
shared_ptr<VarOverview> v;
|
shared_ptr<VarOverview> v;
|
||||||
if (super == nullptr) {
|
if (super == nullptr) {
|
||||||
|
@ -588,7 +588,7 @@ void ExecutionNode::staticAnalysis (ExecutionNode* super) {
|
||||||
// Now handle the subqueries:
|
// Now handle the subqueries:
|
||||||
for (auto s : v->subQueryNodes) {
|
for (auto s : v->subQueryNodes) {
|
||||||
auto sq = static_cast<SubqueryNode*>(s);
|
auto sq = static_cast<SubqueryNode*>(s);
|
||||||
sq->getSubquery()->staticAnalysis(s);
|
sq->getSubquery()->planRegisters(s);
|
||||||
}
|
}
|
||||||
v->reset();
|
v->reset();
|
||||||
|
|
||||||
|
|
|
@ -566,7 +566,7 @@ namespace triagens {
|
||||||
/// @brief static analysis
|
/// @brief static analysis
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void staticAnalysis (ExecutionNode* super = nullptr);
|
void planRegisters (ExecutionNode* super = nullptr);
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief get varOverview
|
/// @brief get varOverview
|
||||||
|
@ -694,13 +694,13 @@ namespace triagens {
|
||||||
ExecutionPlan* _plan;
|
ExecutionPlan* _plan;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief info about variables, filled in by staticAnalysis
|
/// @brief info about variables, filled in by planRegisters
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
std::shared_ptr<VarOverview> _varOverview;
|
std::shared_ptr<VarOverview> _varOverview;
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
/// @brief depth of the current frame, will be filled in by staticAnalysis
|
/// @brief depth of the current frame, will be filled in by planRegisters
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
int _depth;
|
int _depth;
|
||||||
|
|
|
@ -234,8 +234,8 @@ namespace triagens {
|
||||||
/// @brief static analysis
|
/// @brief static analysis
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
void staticAnalysis () {
|
void planRegisters () {
|
||||||
_root->staticAnalysis();
|
_root->planRegisters();
|
||||||
}
|
}
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
Loading…
Reference in New Issue