Don't check monotonicity when analyze projections

This commit is contained in:
Amos Bird 2023-07-16 23:35:18 +08:00
parent 9b0eb9cdd7
commit 696818b340
No known key found for this signature in database
GPG Key ID: 80D430DCBECFEDB4
3 changed files with 4 additions and 4 deletions

View File

@ -8,7 +8,7 @@
namespace DB
{
MatchedTrees::Matches matchTrees(const ActionsDAG & inner_dag, const ActionsDAG & outer_dag)
MatchedTrees::Matches matchTrees(const ActionsDAG & inner_dag, const ActionsDAG & outer_dag, bool check_monotonicity)
{
using Parents = std::set<const ActionsDAG::Node *>;
std::unordered_map<const ActionsDAG::Node *, Parents> inner_parents;
@ -182,7 +182,7 @@ MatchedTrees::Matches matchTrees(const ActionsDAG & inner_dag, const ActionsDAG
}
}
if (!match.node && frame.node->function_base->hasInformationAboutMonotonicity())
if (!match.node && check_monotonicity && frame.node->function_base->hasInformationAboutMonotonicity())
{
size_t num_const_args = 0;
const ActionsDAG::Node * monotonic_child = nullptr;

View File

@ -39,5 +39,5 @@ struct MatchedTrees
using Matches = std::unordered_map<const ActionsDAG::Node *, Match>;
};
MatchedTrees::Matches matchTrees(const ActionsDAG & inner_dag, const ActionsDAG & outer_dag);
MatchedTrees::Matches matchTrees(const ActionsDAG & inner_dag, const ActionsDAG & outer_dag, bool check_monotonicity = true);
}

View File

@ -287,7 +287,7 @@ ActionsDAGPtr analyzeAggregateProjection(
{
auto proj_index = buildDAGIndex(*info.before_aggregation);
MatchedTrees::Matches matches = matchTrees(*info.before_aggregation, *query.dag);
MatchedTrees::Matches matches = matchTrees(*info.before_aggregation, *query.dag, false /* check_monotonicity */);
// for (const auto & [node, match] : matches)
// {