30000
60000
30000000000
millions
50
100
window
10
1000
10000
create table moving_sum_{millions}m engine MergeTree order by k as select number % 100 k, rand() v from numbers_mt(1000000 * {millions})
optimize table moving_sum_{millions}m final
select k, groupArrayMovingSum({window})(v) from moving_sum_{millions}m group by k format Null
select k % 10 kk, groupArrayMovingSum({window})(v) from moving_sum_{millions}m group by kk format Null
drop table if exists moving_sum_{millions}m