long 10000 20000 table numbers(10000000) numbers_mt(100000000) size 1 16 1024 16384 1048576 10000000 SELECT count() FROM {table} WHERE rand64() IN (SELECT number FROM system.numbers LIMIT {size})