If you have really wide table with many thousands of columns and you want to drop / modify column.
For wide parts it working fine, but for compact clickhouse would try to allocate a lot of memory and going to be killed via OOM killer.



**Does it reproduce on recent release?**

Yes, 21.9

**How to reproduce**
```
clickhouse-client -mn --query="SELECT 'CREATE TABLE xxx_really_wide( ' || arrayStringConcat(groupArray('column_'|| toString(number) || ' Nullable(UInt32)'), ',') || ') ENGINE=MergeTree ORDER BY assumeNotNull(column_0)' FROM numbers(6000) FORMAT TSVRaw" | clickhouse-client -mn

clickhouse-client -mn --query="SELECT arrayStringConcat(replicate('1', range(6000)), ',') FROM numbers(300) FORMAT TSVRaw" | clickhouse-client -mn --query "INSERT INTO xxx_really_wide FORMAT CSV " --send_logs_level='trace'
```

```
SELECT *
FROM system.merges
FORMAT Vertical

Query id: d9751847-a689-49f0-aab3-f868d9c08e34

Row 1:
──────
database:                    default
table:                       xxx_really_wide
elapsed:                     84.8952157
progress:                    0
num_parts:                   1
source_part_names:           ['all_1_1_0']
result_part_name:            all_1_1_0_3
source_part_paths:           ['/var/lib/clickhouse/data/default/xxx_really_wide/all_1_1_0/']
result_part_path:            /var/lib/clickhouse/data/default/xxx_really_wide/all_1_1_0_3/
partition_id:                all
is_mutation:                 1
total_size_bytes_compressed: 456027
total_size_marks:            2
bytes_read_uncompressed:     0
rows_read:                   0
bytes_written_uncompressed:  0
rows_written:                0
columns_written:             0
memory_usage:                16836533272
thread_id:                   16171
merge_type:
merge_algorithm:

Row 2:
──────
database:                    default
table:                       xxx_really_wide
elapsed:                     84.8947852
progress:                    0
num_parts:                   1
source_part_names:           ['all_2_2_0']
result_part_name:            all_2_2_0_3
source_part_paths:           ['/var/lib/clickhouse/data/default/xxx_really_wide/all_2_2_0/']
result_part_path:            /var/lib/clickhouse/data/default/xxx_really_wide/all_2_2_0_3/
partition_id:                all
is_mutation:                 1
total_size_bytes_compressed: 468027
total_size_marks:            2
bytes_read_uncompressed:     0
rows_read:                   0
bytes_written_uncompressed:  0
rows_written:                0
columns_written:             0
memory_usage:                16706294896
thread_id:                   16174
merge_type:
merge_algorithm:
```

if (it == std::cend(indices_desc))
                throw Exception("Unknown index: " + command.index_name, ErrorCodes::BAD_ARGUMENTS);
            auto query = (*it).expression_list_ast->clone();
            auto syntax_result = TreeRewriter(context).analyze(query, all_columns);
            const auto required_columns = syntax_result->requiredSourceColumns();
            for (const auto & column : required_columns)
                dependencies.emplace(column, ColumnDependency::SKIP_INDEX);
            materialized_indices.emplace(command.index_name);
        }
        else if (command.type == MutationCommand::MATERIALIZE_PROJECTION)
        {
            mutation_kind.set(MutationKind::MUTATE_INDEX_PROJECTION);
            const auto & projection = projections_desc.get(command.projection_name);
            for (const auto & column : projection.required_columns)
                dependencies.emplace(column, ColumnDependency::PROJECTION);
            materialized_projections.emplace(command.projection_name);
        }
        else if (command.type == MutationCommand::DROP_INDEX)
        {
            mutation_kind.set(MutationKind::MUTATE_INDEX_PROJECTION);
            materialized_indices.erase(command.index_name);
        }
        else if (command.type == MutationCommand::DROP_PROJECTION)
        {
            mutation_kind.set(MutationKind::MUTATE_INDEX_PROJECTION);
            materialized_projections.erase(command.projection_name);
        }
        else if (command.type == MutationCommand::MATERIALIZE_TTL)
        {
            mutation_kind.set(MutationKind::MUTATE_OTHER);