Add isolated performance test

This commit is contained in:
Jiebin Sun 2024-05-28 23:52:19 +08:00
parent 48ca5d48b1
commit bc4d96481c

View File

@ -0,0 +1,42 @@
<test>
<substitutions>
<substitution>
<name>serialization</name>
<values>
<value>sparse</value>
</values>
</substitution>
<substitution>
<name>ratio</name>
<values>
<value>10</value>
<value>100</value>
<value>1000</value>
</values>
</substitution>
</substitutions>
<create_query>
CREATE TABLE test_{serialization}_{ratio} (id UInt64, u8 UInt8, u64 UInt64, str String)
ENGINE = MergeTree ORDER BY id
SETTINGS ratio_of_defaults_for_sparse_serialization = 0.8
</create_query>
<create_query>SYSTEM STOP MERGES test_{serialization}_{ratio}</create_query>
<fill_query>
INSERT INTO test_{serialization}_{ratio} SELECT
number,
number % {ratio} = 0 ? rand(1) : 0,
number % {ratio} = 0 ? rand(2) : 0,
number % {ratio} = 0 ? randomPrintableASCII(64, 3) : ''
FROM numbers(100000000)
</fill_query>
<query>SELECT str, COUNT(DISTINCT id) as i FROM test_{serialization}_{ratio} WHERE notEmpty(str) GROUP BY str ORDER BY i DESC LIMIT 10</query>
<query>SELECT str, COUNT(DISTINCT u8) as u FROM test_{serialization}_{ratio} WHERE notEmpty(str) GROUP BY str ORDER BY u DESC LIMIT 10</query>
<query>SELECT str, COUNT(DISTINCT u64) as u FROM test_{serialization}_{ratio} WHERE notEmpty(str) GROUP BY str ORDER BY u DESC LIMIT 10</query>
<drop_query>DROP TABLE IF EXISTS test_{serialization}_{ratio}</drop_query>
</test>