8000 Feature/improve registerplanning reduce depth by goedderz · Pull Request #11603 · arangodb/arangodb · GitHub
[go: up one dir, main page]

Skip to content

Feature/improve registerplanning reduce depth #11603

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
May 18, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

8000
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix
  • Loading branch information
goedderz committed May 13, 2020
commit 2f266253ddd4fb82226f7a88fabe502188cd946b
6 changes: 2 additions & 4 deletions arangod/Aql/RegisterPlan.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ auto RegisterPlanT<T>::clone() -> std::shared_ptr<RegisterPlanT> {
}

template <typename T>
void RegisterPlanT<T>::addSection() {
void RegisterPlanT<T>::increaseDepth() {
currentSection++;
// create a copy of the last value here
// this is required because back returns a reference and emplace/push_back
Expand All @@ -291,9 +291,7 @@ void RegisterPlanT<T>::addSection() {

template <typename T>
RegisterId RegisterPlanT<T>::addRegister() {
nrRegs[currentSection]++;

return static_cast<RegisterId>(nrRegs[currentSection]);
return static_cast<RegisterId>(nrRegs[depth]++);
}

template <typename T>
Expand Down
5 changes: 2 additions & 3 deletions arangod/Aql/RegisterPlan.h
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ struct RegisterPlanT final : public std::enable_shared_from_this<RegisterPlanT<T
std::shared_ptr<RegisterPlanT> clone();

void registerVariable(VariableId v, std::set<RegisterId>& unusedRegisters);
/// @brief was previously named `increaseDepth`
void addSection();
void increaseDepth();
auto addRegister() -> RegisterId;
void addSubqueryNode(T* subquery);

Expand All @@ -126,7 +125,7 @@ struct RegisterPlanT final : public std::enable_shared_from_this<RegisterPlanT<T
std::vector<Variable const*> const& varsSetHere) const -> RegIdSetStack;

private:
unsigned int currentSection;
unsigned int depth;
};

template <typename T>
Expand Down
2 changes: 1 addition & 1 deletion tests/Aql/RegisterPlanTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ struct PlanMiniMock {
auto increaseCounter(ExecutionNode::NodeType type) {
// This is no longer true for subqueries because reasons, i.e. subqueries
// are planned multiple times
// TODO: refactor subquery planing?
// TODO: refactor subquery planning?
// EXPECT_FALSE(_called) << "Only count every node once per run";
EXPECT_EQ(_expectedType, type) << "Count the correct type";
}
Expand Down
0