```
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;
```
{
    return total_active_size_parts.load(std::memory_order_acquire);
}
std::pair<size_t, size_t> MergeTreeData::getMaxPartsCountAndSizeForPartitionWithState(DataPartState state) const
{
    auto lock = lockParts();
    size_t cur_parts_count = 0;
    size_t cur_parts_size = 0;
    size_t max_parts_count = 0;
    size_t argmax_parts_size = 0;
    const String * cur_partition_id = nullptr;
    for (const auto & part : getDataPartsStateRange(state))
    {
        if (!cur_partition_id || part->info.partition_id != *cur_partition_id)
        {
            cur_partition_id = &part->info.partition_id;
            cur_parts_count = 0;
            cur_parts_size = 0;
        }
        ++cur_parts_count;
        cur_parts_size += part->getBytesOnDisk();
        if (cur_parts_count > max_parts_count)
        {
            max_parts_count = cur_parts_count;
            argmax_parts_size = cur_parts_size;
        }
    }
    return {max_parts_count, argmax_parts_size};
}
std::pair<size_t, size_t> MergeTreeData::getMaxPartsCountAndSizeForPartition() const