Moving Sum
loop
30000
6000
60000
CREATE TABLE moving_sum_1m(k UInt64, v UInt64) ENGINE = MergeTree ORDER BY k
CREATE TABLE moving_sum_10m(k UInt64, v UInt64) ENGINE = MergeTree ORDER BY k
INSERT INTO moving_sum_1m SELECT number%100, rand() from numbers(1000000)
INSERT INTO moving_sum_10m SELECT number%100, rand() from numbers(10000000)
SELECT k,groupArrayMovingSum(10)(v) FROM moving_sum_1m GROUP BY k
SELECT k,groupArrayMovingSum(10)(v) FROM moving_sum_1m WHERE k in (49, 50, 51) GROUP BY k
SELECT k,groupArrayMovingSum(1000)(v) FROM moving_sum_1m GROUP BY k
SELECT k,groupArrayMovingSum(1000)(v) FROM moving_sum_1m WHERE k in (49, 50, 51) GROUP BY k
SELECT k,groupArrayMovingSum(10000)(v) FROM moving_sum_1m GROUP BY k
SELECT k,groupArrayMovingSum(10000)(v) FROM moving_sum_1m WHERE k in (49, 50, 51) GROUP BY k
SELECT k,groupArrayMovingSum(10)(v) FROM moving_sum_10m GROUP BY k
SELECT k,groupArrayMovingSum(10)(v) FROM moving_sum_10m WHERE k in (49, 50, 51) GROUP BY k
SELECT k,groupArrayMovingSum(1000)(v) FROM moving_sum_10m GROUP BY k
SELECT k,groupArrayMovingSum(1000)(v) FROM moving_sum_10m WHERE k in (49, 50, 51) GROUP BY k
SELECT k,groupArrayMovingSum(10000)(v) FROM moving_sum_10m GROUP BY k
SELECT k,groupArrayMovingSum(10000)(v) FROM moving_sum_10m WHERE k in (49, 50, 51) GROUP BY k
DROP TABLE IF EXISTS moving_sum_10m
DROP TABLE IF EXISTS moving_sum_1m