This commit is contained in:
Alexander Kuzmenkov 2020-03-17 17:36:24 +03:00
parent 1b7954cbae
commit 81631e4e6a

View File

@ -19,32 +19,32 @@
Мы запускаем этот запрос и наблюдаем, с какой скоростью он выполняется. Через несколько секунд, когда скорость стабилизируется, прерываем выполнение.
В качестве скорости выполнения запроса указывается количество обработанных исходных (прочитанных из таблицы) данных в единицу времени.
Например, в таблице numbers читаемые нами данные - это числа типа UInt64 (8 байт). Если мы обрабатываем миллиард таких чисел в секунду, то отобразится скорость - 8 GB/sec. -->
<query>SELECT count() FROM zeros( 10000000) WHERE NOT ignore(rand())</query>
<query>SELECT count() FROM zeros_mt(160000000) WHERE NOT ignore(rand())</query>
<query>SELECT count() FROM zeros( 100000000) WHERE NOT ignore(rand())</query>
<query>SELECT count() FROM zeros_mt(1600000000) WHERE NOT ignore(rand())</query>
<!-- 10. Некриптографическая хэш-функция для целых чисел 64bit -> 64bit. -->
<query>SELECT count() FROM numbers( 10000000) WHERE NOT ignore(intHash64(number))</query>
<query>SELECT count() FROM numbers_mt(160000000) WHERE NOT ignore(intHash64(number))</query>
<query>SELECT count() FROM numbers( 100000000) WHERE NOT ignore(intHash64(number))</query>
<query>SELECT count() FROM numbers_mt(1600000000) WHERE NOT ignore(intHash64(number))</query>
<!-- 11. Некриптографическая хэш-функция для целых чисел 64bit -> 32bit. -->
<query>SELECT count() FROM numbers( 10000000) WHERE NOT ignore(intHash32(number))</query>
<query>SELECT count() FROM numbers_mt(160000000) WHERE NOT ignore(intHash32(number))</query>
<query>SELECT count() FROM numbers( 100000000) WHERE NOT ignore(intHash32(number))</query>
<query>SELECT count() FROM numbers_mt(1600000000) WHERE NOT ignore(intHash32(number))</query>
<!-- 12. Преобразование целого числа в строку в десятичном виде. -->
<query>SELECT count() FROM numbers( 1000000) WHERE NOT ignore(toString(number))</query>
<query>SELECT count() FROM numbers_mt(16000000) WHERE NOT ignore(toString(number))</query>
<query>SELECT count() FROM numbers( 10000000) WHERE NOT ignore(toString(number))</query>
<query>SELECT count() FROM numbers_mt(160000000) WHERE NOT ignore(toString(number))</query>
<!-- 13. Преобразование целого числа в строку путём копирования куска памяти. -->
<query>SELECT count() FROM numbers( 10000000) WHERE NOT ignore(reinterpretAsString(number))</query>
<query>SELECT count() FROM numbers_mt(160000000) WHERE NOT ignore(reinterpretAsString(number))</query>
<query>SELECT count() FROM numbers( 100000000) WHERE NOT ignore(reinterpretAsString(number))</query>
<query>SELECT count() FROM numbers_mt(1600000000) WHERE NOT ignore(reinterpretAsString(number))</query>
<!-- 26. Целочисленное деление на константу. Используется библиотека libdivide. -->
<query>SELECT count() FROM numbers( 10000000) WHERE NOT ignore(number / 7)</query>
<query>SELECT count() FROM numbers_mt(160000000) WHERE NOT ignore(number / 7)</query>
<query>SELECT count() FROM numbers( 100000000) WHERE NOT ignore(number / 7)</query>
<query>SELECT count() FROM numbers_mt(1600000000) WHERE NOT ignore(number / 7)</query>
<!-- 27. Целочисленное деление на константу. -->
<query>SELECT count() FROM numbers( 10000000) WHERE NOT ignore(number % 7)</query>
<query>SELECT count() FROM numbers_mt(160000000) WHERE NOT ignore(number % 7)</query>
<query>SELECT count() FROM numbers( 100000000) WHERE NOT ignore(number % 7)</query>
<query>SELECT count() FROM numbers_mt(1600000000) WHERE NOT ignore(number % 7)</query>
<!-- 28. Целочисленное деление на константу. -->
<query>SELECT count() FROM numbers( 10000000) WHERE NOT ignore(number % 34908756)</query>
<query>SELECT count() FROM numbers_mt(160000000) WHERE NOT ignore(number % 34908756)</query>
<query>SELECT count() FROM numbers( 100000000) WHERE NOT ignore(number % 34908756)</query>
<query>SELECT count() FROM numbers_mt(1600000000) WHERE NOT ignore(number % 34908756)</query>
<!-- 29. Lookup-таблица, помещающаяся в L2-кэш. -->
<query>SELECT number % 1000 AS k, count() FROM numbers( 10000000) GROUP BY k FORMAT Null</query>
<query>SELECT number % 1000 AS k, count() FROM numbers_mt(160000000) GROUP BY k FORMAT Null</query>
<query>SELECT number % 1000 AS k, count() FROM numbers( 100000000) GROUP BY k FORMAT Null</query>
<query>SELECT number % 1000 AS k, count() FROM numbers_mt(1600000000) GROUP BY k FORMAT Null</query>
<!-- 30. Хэш-таблица, помещающаяся в L3-кэш. -->
<query>SELECT number % 100000 AS k, count() FROM numbers( 10000000) GROUP BY k FORMAT Null</query>
<query>SELECT number % 100000 AS k, count() FROM numbers_mt(160000000) GROUP BY k FORMAT Null</query>
@ -52,14 +52,14 @@
<query>SELECT number % 1000000 AS k, count() FROM numbers( 10000000) GROUP BY k FORMAT Null</query>
<query>SELECT number % 1000000 AS k, count() FROM numbers_mt(160000000) GROUP BY k FORMAT Null</query>
<!-- 32. Хэш-таблица, не помещающаяся в L3-кэш. -->
<query>SELECT number % 10000000 AS k, count() FROM numbers( 100000000) GROUP BY k FORMAT Null</query>
<query>SELECT number % 10000000 AS k, count() FROM numbers_mt(1600000000) GROUP BY k FORMAT Null</query>
<query>SELECT number % 10000000 AS k, count() FROM numbers( 10000000) GROUP BY k FORMAT Null</query>
<query>SELECT number % 10000000 AS k, count() FROM numbers_mt(80000000) GROUP BY k FORMAT Null</query>
<!-- 33. Хэш-таблица, требующая кучу оперативки. Возможны интересные эффекты. -->
<query>SELECT number % 500000000 AS k, count() FROM numbers( 1000000000) GROUP BY k FORMAT Null</query>
<query>SELECT number % 500000000 AS k, count() FROM numbers_mt(16000000000) GROUP BY k FORMAT Null</query>
<query>SELECT number % 500000000 AS k, count() FROM numbers( 100000000) GROUP BY k FORMAT Null</query>
<query>SELECT number % 500000000 AS k, count() FROM numbers_mt(800000000) GROUP BY k FORMAT Null</query>
<!-- 35. Кэш-промахи, осуществляемые из многих процессорных ядер. -->
<!-- <query>SELECT number % (intDiv(100000000, {THREADS})) AS k, count() FROM numbers_mt(1600000000) GROUP BY k</query> -->
<!-- 46. Запрос, требующий много бесполезных копирований. -->
<query>SELECT count() FROM zeros(10000000) WHERE NOT ignore(materialize('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') AS s, concat(s,s,s,s,s,s,s,s,s,s) AS t, concat(t,t,t,t,t,t,t,t,t,t) AS u) SETTINGS max_block_size = 1000</query>
<query>SELECT count() FROM zeros(1000000) WHERE NOT ignore(materialize('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx') AS s, concat(s,s,s,s,s,s,s,s,s,s) AS t, concat(t,t,t,t,t,t,t,t,t,t) AS u) SETTINGS max_block_size = 1000</query>
</test>