diff --git a/src/Processors/QueryPlan/Optimizations/distinctReadInOrder.cpp b/src/Processors/QueryPlan/Optimizations/distinctReadInOrder.cpp index d9ed690a6ff..ea7252fcd96 100644 --- a/src/Processors/QueryPlan/Optimizations/distinctReadInOrder.cpp +++ b/src/Processors/QueryPlan/Optimizations/distinctReadInOrder.cpp @@ -54,7 +54,7 @@ size_t tryDistinctReadInOrder(QueryPlan::Node * parent_node, QueryPlan::Nodes &) const SortDescription & sort_desc = output.sort_description; const auto & distinct_columns = pre_distinct->getOutputStream().header.getNames(); /// apply optimization only when distinct columns match or form prefix of sorting key - /// todo: check if reading in order optimization would be benefitial sorting key is prefix of columns in DISTINCT + /// todo: check if reading in order optimization would be beneficial if sorting key is prefix of columns in DISTINCT if (sort_desc.size() < distinct_columns.size()) return 0; @@ -71,8 +71,6 @@ size_t tryDistinctReadInOrder(QueryPlan::Node * parent_node, QueryPlan::Nodes &) if (distinct_sort_desc.empty()) return 0; - LOG_ERROR(&Poco::Logger::get("DistinctOptimization"), "DISTINCT sort description: {}", dumpSortDescription(distinct_sort_desc)); - InputOrderInfoPtr order_info = std::make_shared(distinct_sort_desc, distinct_sort_desc.size(), 1, pre_distinct->getLimitHint()); read_from_merge_tree->setQueryInfoInputOrderInfo(order_info);