Files
datastore/tests/performance/jit_aggregate_functions.xml
Raúl Marín 064130bb36 Reduce JIT-induced noise in performance tests
Most performance tests already disable JIT via `compile_expressions=0`,
`compile_aggregate_expressions=0` and `compile_sort_description=0` in
`perf-comparison-tweaks-users.xml`. Tests that explicitly opt back into JIT
were still bimodal: the JIT cache is global and shared across queries, so
whether the first measured runs hit it or not depends on what ran before.

Set `min_count_to_compile_expression`, `min_count_to_compile_aggregate_expression`
and `min_count_to_compile_sort_description` to 0 in the same profile so that
when a test does enable JIT, compilation happens on the very first call and
the existing prewarm run populates the cache before measurements start.

Drop now-redundant per-test overrides of the same settings.
2026-05-08 11:49:12 +02:00

297 lines
7.8 KiB
XML

<test>
<settings>
<compile_aggregate_expressions>1</compile_aggregate_expressions>
</settings>
<create_query>
CREATE TABLE jit_test_memory (
key UInt64,
value_1 UInt64,
value_2 UInt64,
value_3 UInt64,
value_4 UInt64,
value_5 UInt64,
predicate UInt8
) Engine = Memory
</create_query>
<create_query>
CREATE TABLE jit_test_merge_tree (
key UInt64,
value_1 UInt64,
value_2 UInt64,
value_3 UInt64,
value_4 UInt64,
value_5 UInt64,
predicate UInt8
) Engine = MergeTree
ORDER BY key
</create_query>
<create_query>
CREATE TABLE jit_test_memory_nullable (
key UInt64,
value_1 Nullable(UInt64),
value_2 Nullable(UInt64),
value_3 Nullable(UInt64),
value_4 Nullable(UInt64),
value_5 Nullable(UInt64),
predicate UInt8
) Engine = Memory
</create_query>
<create_query>
CREATE TABLE jit_test_merge_tree_nullable (
key UInt64,
value_1 Nullable(UInt64),
value_2 Nullable(UInt64),
value_3 Nullable(UInt64),
value_4 Nullable(UInt64),
value_5 Nullable(UInt64),
predicate UInt8
) Engine = MergeTree
ORDER BY key
</create_query>
<substitutions>
<substitution>
<name>function</name>
<values>
<value>sum</value>
<value>min</value>
<value>max</value>
<value>avg</value>
<value>any</value>
<value>anyLast</value>
<value>count</value>
<value>groupBitOr</value>
<value>groupBitAnd</value>
<value>groupBitXor</value>
</values>
</substitution>
<substitution>
<name>table</name>
<values>
<value>jit_test_memory</value>
<value>jit_test_merge_tree</value>
<value>jit_test_memory_nullable</value>
<value>jit_test_merge_tree_nullable</value>
</values>
</substitution>
<substitution>
<name>group_scale</name>
<values>
<value>1000000</value>
</values>
</substitution>
</substitutions>
<fill_query>
INSERT INTO {table}
SELECT
number % 1000000,
number,
number,
number,
number,
number,
if (number % 2 == 0, 1, 0)
FROM
system.numbers_mt
LIMIT 10000000
</fill_query>
<query>
SELECT
{function}(value_1),
{function}(value_2),
{function}(value_3)
FROM {table}
GROUP BY key
FORMAT Null
</query>
<query>
SELECT
{function}(value_1),
{function}(value_2),
sum(toUInt256(value_3)),
{function}(value_3)
FROM {table}
GROUP BY key
FORMAT Null
</query>
<query>
SELECT
{function}If(value_1, predicate),
{function}If(value_2, predicate),
{function}If(value_3, predicate)
FROM {table}
GROUP BY key
FORMAT Null
</query>
<query>
SELECT
{function}If(value_1, predicate),
{function}If(value_2, predicate),
sumIf(toUInt256(value_3), predicate),
{function}If(value_3, predicate)
FROM {table}
GROUP BY key
FORMAT Null
</query>
<query>
SELECT
{function}(value_1),
{function}(value_2),
{function}(value_3),
{function}(value_4),
{function}(value_5)
FROM {table}
GROUP BY key
FORMAT Null
</query>
<query>
SELECT
{function}(value_1),
{function}(value_2),
sum(toUInt256(value_3)),
{function}(value_3),
{function}(value_4),
{function}(value_5)
FROM {table}
GROUP BY key
FORMAT Null
</query>
<query>
SELECT
{function}If(value_1, predicate),
{function}If(value_2, predicate),
{function}If(value_3, predicate),
{function}If(value_4, predicate),
{function}If(value_5, predicate)
FROM {table}
GROUP BY key
FORMAT Null
</query>
<query>
SELECT
{function}If(value_1, predicate),
{function}If(value_2, predicate),
sumIf(toUInt256(value_3), predicate),
{function}If(value_3, predicate),
{function}If(value_4, predicate),
{function}If(value_5, predicate)
FROM {table}
GROUP BY key
FORMAT Null
</query>
<query>
SELECT
{function}(WatchID),
{function}(CounterID),
{function}(ClientIP)
FROM hits_100m_single
GROUP BY intHash32(UserID) % {group_scale}
FORMAT Null
</query>
<query>
SELECT
{function}(WatchID),
{function}(CounterID),
sum(toUInt256(ClientIP)),
{function}(ClientIP)
FROM hits_100m_single
GROUP BY intHash32(UserID) % {group_scale}
FORMAT Null
</query>
<query>
SELECT
{function}(WatchID),
{function}(CounterID),
{function}(ClientIP),
{function}(IPNetworkID),
{function}(SearchEngineID)
FROM hits_100m_single
GROUP BY intHash32(UserID) % {group_scale}
FORMAT Null
</query>
<query>
SELECT
{function}(WatchID),
{function}(CounterID),
sum(toUInt256(ClientIP)),
{function}(ClientIP),
{function}(IPNetworkID),
{function}(SearchEngineID)
FROM hits_100m_single
GROUP BY intHash32(UserID) % {group_scale}
FORMAT Null
</query>
<query>
WITH (WatchID % 2 == 0) AS predicate
SELECT
{function}If(WatchID, predicate),
{function}If(CounterID, predicate),
{function}If(ClientIP, predicate)
FROM hits_100m_single
GROUP BY intHash32(UserID) % {group_scale}
FORMAT Null
</query>
<query>
WITH (WatchID % 2 == 0) AS predicate
SELECT
{function}If(WatchID, predicate),
{function}If(CounterID, predicate),
sumIf(toUInt256(ClientIP), predicate),
{function}If(ClientIP, predicate)
FROM hits_100m_single
GROUP BY intHash32(UserID) % {group_scale}
FORMAT Null
</query>
<query>
WITH (WatchID % 2 == 0) AS predicate
SELECT
{function}If(WatchID, predicate),
{function}If(CounterID, predicate),
{function}If(ClientIP, predicate),
{function}If(IPNetworkID, predicate),
{function}If(SearchEngineID, predicate)
FROM hits_100m_single
GROUP BY intHash32(UserID) % {group_scale}
FORMAT Null
</query>
<query>
WITH (WatchID % 2 == 0) AS predicate
SELECT
{function}If(WatchID, predicate),
{function}If(CounterID, predicate),
sumIf(toUInt256(ClientIP), predicate),
{function}If(ClientIP, predicate),
{function}If(IPNetworkID, predicate),
{function}If(SearchEngineID, predicate)
FROM hits_100m_single
GROUP BY intHash32(UserID) % {group_scale}
FORMAT Null
</query>
<drop_query>DROP TABLE IF EXISTS {table}</drop_query>
</test>