create table t(a UInt32) engine=MergeTree order by tuple() partition by a % 16 insert into t select * from numbers_mt(5e7) select a from t group by a format Null drop table t