table_small
zeros(10000000)
zeros_mt(100000000)
table_large
zeros(100000000)
zeros_mt(1000000000)
size_large
1048576
10000000
size_small
1
16
1024
16384
SELECT count() FROM {table_large} WHERE rand64() IN (SELECT number FROM system.numbers LIMIT {size_small})
SELECT count() FROM {table_small} WHERE rand64() IN (SELECT number FROM system.numbers LIMIT {size_large})
SELECT number
FROM numbers(10)
WHERE (number IN
(
SELECT sum(number)
FROM numbers(100000000)
GROUP BY bitAnd(number, 15)
)) OR (number IN
(
SELECT sum(number)
FROM numbers(100000000)
GROUP BY bitAnd(number, 17)
))