Add a setting to control what to do with indices during mutations#89335
Add a setting to control what to do with indices during mutations#89335Algunenano merged 24 commits intoClickHouse:masterfrom
Conversation
|
Workflow [PR], commit [cd4a414] Summary: ❌
|
dc27321 to
82a8e7e
Compare
| extern const MergeTreeSettingsBool allow_suspicious_indices; | ||
| extern const MergeTreeSettingsBool allow_summing_columns_in_partition_or_order_key; | ||
| extern const MergeTreeSettingsBool allow_coalescing_columns_in_partition_or_order_key; | ||
| extern const MergeTreeSettingsAlterColumnSecondaryIndexMode alter_column_secondary_index_mode; |
There was a problem hiding this comment.
[very minor] maybe them after the MergeTreeSettingsBool properties? It makes it easier to read them
There was a problem hiding this comment.
It's shorted by alphabetical order of the setting name (last column) but we can change it
| { | ||
| ASTPtr expr_list = index.expression_list_ast->clone(); | ||
| for (const auto & expr : expr_list->children) | ||
| indices_recalc_expr_list->children.push_back(expr->clone()); |
There was a problem hiding this comment.
[minor] do we need to clone the expr from the cloned list? can we avoid allocation and just move?
There was a problem hiding this comment.
I moved it from the existing code (in getIndicesToRecalculate), I'll have a look to see if we need to clone of we can simply move it (if deep cloned).
|
Is the plan to change the default to rebuild? |
|
Yes, this PR changes the default to rebuild |
|
25.11 has been released. Need to change the settings history |
2453a19
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Add a MergeTree setting
alter_column_secondary_index_modeto control what to do with indices during mutations. Possible values: throw, drop, rebuild, and compatibility. Closes #77797Documentation entry for user-facing changes
Details
The setting
alter_column_secondary_index_modecontrols behavior of secondary indices during mutations:throwwill prevent doing ALTER COLUMN MODIFY, UPDATE and DELETE of columns covered by secondary indices or if these mutations will require rewriting the index (DELETES always do).dropwill drop the dependent secondary indices that would otherwise need to be rewritten.rebuildrebuilds any indices affected by the mutation commands.compatibilitykeeps the old behaviour: It throws for ALTER COLUMN MODIFY, and it rebuilds for UPDATE or DELETE.Closes #77797