diff --git a/src/Interpreters/ComparisonGraph.cpp b/src/Interpreters/ComparisonGraph.cpp index 25a1a346886..2e5703dd58f 100644 --- a/src/Interpreters/ComparisonGraph.cpp +++ b/src/Interpreters/ComparisonGraph.cpp @@ -115,9 +115,6 @@ std::pair ComparisonGraph::findPath(const size_t start, const size_t return {false, false}; else { - //Poco::Logger::get("dists found").information(std::to_string(start) + " " + std::to_string(finish) + " : " + std::to_string(static_cast(it->second))); - //Poco::Logger::get("dists found").information(graph.vertexes[start].asts.back()->dumpTree()); - //Poco::Logger::get("dists found").information(graph.vertexes[finish].asts.back()->dumpTree()); return {true, it->second == Path::LESS || not_equal.contains({start, finish})}; } } @@ -135,10 +132,6 @@ ComparisonGraph::CompareResult ComparisonGraph::compare(const ASTPtr & left, con Poco::Logger::get("Graph").information("not found"); Poco::Logger::get("Graph").information(std::to_string(left->getTreeHash().second)); Poco::Logger::get("Graph").information(std::to_string(right->getTreeHash().second)); - /*for (const auto & [hash, id] : graph.ast_hash_to_component) - { - Poco::Logger::get("Graph MAP").information(std::to_string(hash.second) + " " + std::to_string(id)); - }*/ { const auto left_bound = getConstLowerBound(left); const auto right_bound = getConstUpperBound(right); @@ -521,22 +514,6 @@ ComparisonGraph::Graph ComparisonGraph::BuildGraphFromAstsGraph(const Graph & as } } - /*for (size_t v = 0; v < result.vertexes.size(); ++v) - { - std::stringstream s; - for (const auto & atom : result.vertexes[v].asts) - { - s << atom->getTreeHash().second << " "; - } - s << "|"; - for (const auto & atom : result.ast_hash_to_component) - { - s << atom.first.second << " -" << atom.second << " "; - } - - Poco::Logger::get("Graph").information(s.str()); - }*/ - return result; } diff --git a/src/Interpreters/WhereConstraintsOptimizer.cpp b/src/Interpreters/WhereConstraintsOptimizer.cpp index 1d53eab5768..a548eae2eed 100644 --- a/src/Interpreters/WhereConstraintsOptimizer.cpp +++ b/src/Interpreters/WhereConstraintsOptimizer.cpp @@ -87,37 +87,6 @@ bool checkIfGroupAlwaysTrueFullMatch(const CNFQuery::OrGroup & group, const std: ComparisonGraph::CompareResult getExpectedCompare(const CNFQuery::AtomicFormula & atom) { - /*static const std::map inverse_relations = { - {"equals", "notEquals"}, - {"less", "greaterOrEquals"}, - {"lessOrEquals", "greater"}, - {"notEquals", "equals"}, - {"greaterOrEquals", "less"}, - {"greater", "lessOrEquals"}, - }; - - static const std::map relation_to_compare = { - {"equals", ComparisonGraph::CompareResult::EQUAL}, - {"less", ComparisonGraph::CompareResult::LESS}, - {"lessOrEquals", ComparisonGraph::CompareResult::LESS_OR_EQUAL}, - {"notEquals", ComparisonGraph::CompareResult::UNKNOWN}, - {"greaterOrEquals", ComparisonGraph::CompareResult::GREATER_OR_EQUAL}, - {"greater", ComparisonGraph::CompareResult::GREATER}, - }; - - - const auto * func = atom.ast->as(); - if (func && inverse_relations.count(func->name)) - { - std::string function_name = func->name; - if (atom.negative) - { - function_name = inverse_relations.at(func->name); - } - return relation_to_compare.at(function_name); - } - return ComparisonGraph::CompareResult::UNKNOWN;*/ - const auto * func = atom.ast->as(); if (func) { diff --git a/src/Storages/MergeTree/MergeTreeIndexMergedCondition.cpp b/src/Storages/MergeTree/MergeTreeIndexMergedCondition.cpp index e32514c81a0..8352e1c0ff4 100644 --- a/src/Storages/MergeTree/MergeTreeIndexMergedCondition.cpp +++ b/src/Storages/MergeTree/MergeTreeIndexMergedCondition.cpp @@ -89,34 +89,6 @@ namespace ComparisonGraph::CompareResult getExpectedCompare(const CNFQuery::AtomicFormula & atom) { - /*static const std::map inverse_relations = { - {"equals", "notEquals"}, - {"less", "greaterOrEquals"}, - {"lessOrEquals", "greater"}, - {"notEquals", "equals"}, - {"greaterOrEquals", "less"}, - {"greater", "lessOrEquals"}, - }; - - static const std::map relation_to_compare = { - {"equals", ComparisonGraph::CompareResult::EQUAL}, - {"less", ComparisonGraph::CompareResult::LESS}, - {"lessOrEquals", ComparisonGraph::CompareResult::LESS_OR_EQUAL}, - {"notEquals", ComparisonGraph::CompareResult::UNKNOWN}, - {"greaterOrEquals", ComparisonGraph::CompareResult::GREATER_OR_EQUAL}, - {"greater", ComparisonGraph::CompareResult::GREATER}, - }; - - - const auto * func = atom.ast->as(); - if (func && inverse_relations.count(func->name)) - { - std::string function_name = func->name; - if (atom.negative) - function_name = inverse_relations.at(func->name); - return relation_to_compare.at(function_name); - } - return ComparisonGraph::CompareResult::UNKNOWN;*/ const auto * func = atom.ast->as(); if (func) { @@ -212,23 +184,6 @@ bool MergeTreeIndexMergedCondition::mayBeTrueOnGranule(const MergeTreeIndexGranu } } } - /*for (auto atom : or_group) - { - pushNotIn(atom); - for (size_t i = 0; i < values.size(); ++i) - if (values[i]) - for (const auto & hypothesis_or_group : index_to_atomic_hypotheses[i]) - { - if (hypothesis_or_group.size() == 1) - { - const auto & hypothesis_atom = *std::begin(hypothesis_or_group); - if (atom.ast->getTreeHash() == hypothesis_atom.ast->getTreeHash()) - { - return; - } - } - } - }*/ always_false = true; }); return !always_false;