-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1517 from kuzudb/agg-dependency
Add aggreate key dependency optimizer
- Loading branch information
Showing
17 changed files
with
369 additions
and
239 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#pragma once | ||
|
||
#include "logical_operator_visitor.h" | ||
#include "planner/logical_plan/logical_plan.h" | ||
|
||
namespace kuzu { | ||
namespace optimizer { | ||
|
||
// This optimizer analyzes the dependency between group by keys. If key2 depends on key1 (e.g. key1 | ||
// is a primary key column) we only hash on key1 and saves key2 as a payload. | ||
class AggKeyDependencyOptimizer : public LogicalOperatorVisitor { | ||
public: | ||
void rewrite(planner::LogicalPlan* plan); | ||
|
||
private: | ||
void visitOperator(planner::LogicalOperator* op); | ||
|
||
void visitAggregate(planner::LogicalOperator* op) override; | ||
void visitDistinct(planner::LogicalOperator* op) override; | ||
|
||
std::pair<binder::expression_vector, binder::expression_vector> resolveKeysAndDependentKeys( | ||
const binder::expression_vector& keys); | ||
}; | ||
|
||
} // namespace optimizer | ||
} // namespace kuzu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.