Merge pull request #46642 from ClickHouse/remove_redundant_sorting_fix

Fix: remove redundant sorting optimization
This commit is contained in:
Igor Nikonov 2023-02-22 23:33:15 +01:00 committed by GitHub
commit 271b72abf4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -188,7 +188,14 @@ private:
return false;
/// remove sorting
parent_node->children.front() = sorting_node->children.front();
for (auto & child : parent_node->children)
{
if (child == sorting_node)
{
child = sorting_node->children.front();
break;
}
}
/// sorting removed, so need to update sorting traits for upstream steps
const DataStream * input_stream = &parent_node->children.front()->step->getOutputStream();