```
CREATE TABLE t (x UInt8, PROJECTION p (SELECT x GROUP BY x)) ENGINE = MergeTree ORDER BY ();
INSERT INTO t VALUES (0);

SET group_by_overflow_mode = 'any', max_rows_to_group_by = 1000, totals_mode = 'after_having_auto';
SELECT x FROM t GROUP BY x WITH TOTALS;
```
{
    const auto settings = getSettings();
    bool has_zero_copy_parts = false;
    if (settings->allow_remote_fs_zero_copy_replication && dynamic_cast<StorageReplicatedMergeTree *>(this) != nullptr)
    {
        has_zero_copy_parts = std::any_of(
            parts_to_remove.begin(), parts_to_remove.end(),
            [] (const auto & data_part) { return data_part->isStoredOnRemoteDiskWithZeroCopySupport(); }
        );
    }
    if (parts_to_remove.size() > 1
        && settings->max_part_removal_threads > 1
        && parts_to_remove.size() > settings->concurrent_part_removal_threshold
        && !has_zero_copy_parts) 
    {
        
        size_t num_threads = std::min<size_t>(settings->max_part_removal_threads, parts_to_remove.size());
        std::mutex part_names_mutex;
        ThreadPool pool(num_threads);
        
        LOG_DEBUG(log, "Removing {} parts from filesystem: {} (concurrently)", parts_to_remove.size(), fmt::join(parts_to_remove, ", "));
        for (const DataPartPtr & part : parts_to_remove)
        {