Optimize remove unused columns in plan#76487
Conversation
src/Core/Settings.cpp
Outdated
|
|
||
| Note that initially (24.12) there was a server setting (`send_settings_to_client`), but latter it got replaced with this client setting, for better usability. | ||
| )", 0) \ | ||
| DECLARE(Bool, query_plan_try_remove_unused_columns, true, R"( |
There was a problem hiding this comment.
query_plan_remove_unused_columns
|
Just to make it into public knowledge: the current approach is not completely okay, because it might break the rule of subsequent steps must have matching input-output headers. So the plan is to collect the extra columns in the plan from top to bottom, and then remove the ones that can be removed from bottom to the top. |
…sed-columns-in-plan
…sed-columns-in-plan
|
Dear @antaljanosbenjamin, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message. |
|
Dear @antaljanosbenjamin, this PR hasn't been updated for a while. Will you continue working on it? If not, please close it. Otherwise, ignore this message. |
| const auto updated_anything | ||
| = updatedAnything(child_step->removeUnusedColumns(getNameMultiSetFromNames(parent_inputs[child_id]->getNames()), false)); | ||
|
|
||
| // As removeUnusedColumns might leave additional columns in the output, we have get rid of those outputs by adding a new ExpressionStep |
There was a problem hiding this comment.
Can you be more specific here, in what case removeUnusedColumns() cannot remove all unused columns from output?
…sed-columns-in-plan
…sed-columns-in-plan
|
Failed tests:
Merging it manually |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Add optimization to remove unused columns in query plans. Resolves #75152
Details
Resolves #75152