```
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;
```
{
    auto policy = getStoragePolicy();
    if (move_ttl.destination_type == DataDestinationType::VOLUME)
        return policy->tryGetVolumeByName(move_ttl.destination_name);
    else if (move_ttl.destination_type == DataDestinationType::DISK)
        return policy->tryGetDiskByName(move_ttl.destination_name);
    else
        return {};
}
bool MergeTreeData::shouldPerformTTLMoveOnInsert(const SpacePtr & move_destination) const
{
    if (move_destination->isVolume())
    {
        auto volume = std::static_pointer_cast<IVolume>(move_destination);
        return volume->perform_ttl_move_on_insert;
    }
    if (move_destination->isDisk())
    {
        auto disk = std::static_pointer_cast<IDisk>(move_destination);
        if (auto volume = getStoragePolicy()->tryGetVolumeByDiskName(disk->getName()))
            return volume->perform_ttl_move_on_insert;
    }
    return false;
}
bool MergeTreeData::isPartInTTLDestination(const TTLDescription & ttl, const IMergeTreeDataPart & part) const