Simplified hasAll performance tests

This commit is contained in:
Maksim Kita 2022-04-04 13:34:40 +02:00
parent af405d3ba6
commit 3c472a7897
5 changed files with 53 additions and 208 deletions

View File

@ -1,52 +0,0 @@
<test>
<create_query>CREATE TABLE test_table_small (`set` Array(Int16), `subset` Array (Int16)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_small2 (`set` Array(Int16), `subset` Array (Int16)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_smallf (`set` Array(Int16), `subset` Array (Int16)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_medium (`set` Array(Int16), `subset` Array (Int16)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_medium2 (`set` Array(Int16), `subset` Array (Int16)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_mediumf (`set` Array(Int16), `subset` Array (Int16)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_large (`set` Array(Int16), `subset` Array (Int16)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_large2 (`set` Array(Int16), `subset` Array (Int16)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_largef (`set` Array(Int16), `subset` Array (Int16)) ENGINE = MergeTree ORDER BY set </create_query>
<!-- SMALL version -->
<fill_query>INSERT INTO test_table_small SELECT groupArraySample(500)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(500)) </fill_query>
<fill_query>INSERT INTO test_table_small2 SELECT groupArraySample(500)(number) AS set, groupArraySample(400)(number) AS subset FROM (SELECT * FROM numbers(500)) </fill_query>
<fill_query>INSERT INTO test_table_smallf SELECT groupArraySample(500)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(5000000)) </fill_query>
<!-- MEDIUM version -->
<fill_query>INSERT INTO test_table_medium SELECT groupArraySample(1000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(1000000)) </fill_query>
<fill_query>INSERT INTO test_table_medium2 SELECT groupArraySample(1000000)(number) AS set, groupArraySample(4000)(number) AS subset FROM (SELECT * FROM numbers(1000000)) </fill_query>
<fill_query>INSERT INTO test_table_mediumf SELECT groupArraySample(1000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(100000000)) </fill_query>
<!-- LARGE version -->
<fill_query>INSERT INTO test_table_large SELECT groupArraySample(50000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(50000000)) </fill_query>
<fill_query>INSERT INTO test_table_large2 SELECT groupArraySample(50000000)(number) AS set, groupArraySample(8000)(number) AS subset FROM (SELECT * FROM numbers(50000000)) </fill_query>
<fill_query>INSERT INTO test_table_largef SELECT groupArraySample(50000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(1000000000)) </fill_query>
<query tag='SMALL_HASALL_TRUE'>select hasAll(set, subset) from test_table_small</query>
<query tag='SMALL2_HASALL_TRUE'>select hasAll(set, subset) from test_table_small2</query>
<query tag='SMALL_HASALL_FALSE'>select hasAll(set, subset) from test_table_smallf</query>
<query tag='MEDIUM_HASALL_TRUE'>select hasAll(set, subset) from test_table_medium</query>
<query tag='MEDIUM2_HASALL_TRUE'>select hasAll(set, subset) from test_table_medium2</query>
<query tag='MEDIUM_HASALL_FALSE'>select hasAll(set, subset) from test_table_mediumf</query>
<query tag='LARGE_HASALL_TRUE'>select hasAll(set, subset) from test_table_large</query>
<query tag='LARGE2_HASALL_TRUE'>select hasAll(set, subset) from test_table_large2 Settings max_execution_time=300</query>
<query tag='LARGE_HASALL_FALSE'>select hasAll(set, subset) from test_table_largef</query>
<drop_query>DROP TABLE IF EXISTS test_table_small</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_small2</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_smallf</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_medium</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_medium2</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_mediumf</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_large</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_large2</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_largef</drop_query>
</test>

View File

@ -1,52 +0,0 @@
<test>
<create_query>CREATE TABLE test_table_small (`set` Array(Int32), `subset` Array (Int32)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_small2 (`set` Array(Int32), `subset` Array (Int32)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_smallf (`set` Array(Int32), `subset` Array (Int32)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_medium (`set` Array(Int32), `subset` Array (Int32)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_medium2 (`set` Array(Int32), `subset` Array (Int32)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_mediumf (`set` Array(Int32), `subset` Array (Int32)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_large (`set` Array(Int32), `subset` Array (Int32)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_large2 (`set` Array(Int32), `subset` Array (Int32)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_largef (`set` Array(Int32), `subset` Array (Int32)) ENGINE = MergeTree ORDER BY set </create_query>
<!-- SMALL version -->
<fill_query>INSERT INTO test_table_small SELECT groupArraySample(500)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(500)) </fill_query>
<fill_query>INSERT INTO test_table_small2 SELECT groupArraySample(500)(number) AS set, groupArraySample(400)(number) AS subset FROM (SELECT * FROM numbers(500)) </fill_query>
<fill_query>INSERT INTO test_table_smallf SELECT groupArraySample(500)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(5000000)) </fill_query>
<!-- MEDIUM version -->
<fill_query>INSERT INTO test_table_medium SELECT groupArraySample(1000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(1000000)) </fill_query>
<fill_query>INSERT INTO test_table_medium2 SELECT groupArraySample(1000000)(number) AS set, groupArraySample(4000)(number) AS subset FROM (SELECT * FROM numbers(1000000)) </fill_query>
<fill_query>INSERT INTO test_table_mediumf SELECT groupArraySample(1000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(100000000)) </fill_query>
<!-- LARGE version -->
<fill_query>INSERT INTO test_table_large SELECT groupArraySample(50000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(50000000)) </fill_query>
<fill_query>INSERT INTO test_table_large2 SELECT groupArraySample(50000000)(number) AS set, groupArraySample(4000)(number) AS subset FROM (SELECT * FROM numbers(50000000)) Settings max_execution_time=30 </fill_query>
<fill_query>INSERT INTO test_table_largef SELECT groupArraySample(50000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(1000000000)) </fill_query>
<query tag='SMALL_HASALL_TRUE'>select hasAll(set, subset) from test_table_small</query>
<query tag='SMALL2_HASALL_TRUE'>select hasAll(set, subset) from test_table_small2</query>
<query tag='SMALL_HASALL_FALSE'>select hasAll(set, subset) from test_table_smallf</query>
<query tag='MEDIUM_HASALL_TRUE'>select hasAll(set, subset) from test_table_medium</query>
<query tag='MEDIUM2_HASALL_TRUE'>select hasAll(set, subset) from test_table_medium2</query>
<query tag='MEDIUM_HASALL_FALSE'>select hasAll(set, subset) from test_table_mediumf</query>
<query tag='LARGE_HASALL_TRUE'>select hasAll(set, subset) from test_table_large</query>
<query tag='LARGE2_HASALL_TRUE'>select hasAll(set, subset) from test_table_large2 Settings max_execution_time=300</query>
<query tag='LARGE_HASALL_FALSE'>select hasAll(set, subset) from test_table_largef</query>
<drop_query>DROP TABLE IF EXISTS test_table_small</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_small2</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_smallf</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_medium</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_medium2</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_mediumf</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_large</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_large2</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_largef</drop_query>
</test>

View File

@ -1,52 +0,0 @@
<test>
<create_query>CREATE TABLE test_table_small (`set` Array(Int64), `subset` Array (Int64)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_small2 (`set` Array(Int64), `subset` Array (Int64)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_smallf (`set` Array(Int64), `subset` Array (Int64)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_medium (`set` Array(Int64), `subset` Array (Int64)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_medium2 (`set` Array(Int64), `subset` Array (Int64)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_mediumf (`set` Array(Int64), `subset` Array (Int64)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_large (`set` Array(Int64), `subset` Array (Int64)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_large2 (`set` Array(Int64), `subset` Array (Int64)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_largef (`set` Array(Int64), `subset` Array (Int64)) ENGINE = MergeTree ORDER BY set </create_query>
<!-- SMALL version -->
<fill_query>INSERT INTO test_table_small SELECT groupArraySample(500)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(500)) </fill_query>
<fill_query>INSERT INTO test_table_small2 SELECT groupArraySample(500)(number) AS set, groupArraySample(400)(number) AS subset FROM (SELECT * FROM numbers(500)) </fill_query>
<fill_query>INSERT INTO test_table_smallf SELECT groupArraySample(500)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(5000000)) </fill_query>
<!-- MEDIUM version -->
<fill_query>INSERT INTO test_table_medium SELECT groupArraySample(1000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(1000000)) </fill_query>
<fill_query>INSERT INTO test_table_medium2 SELECT groupArraySample(1000000)(number) AS set, groupArraySample(4000)(number) AS subset FROM (SELECT * FROM numbers(1000000)) </fill_query>
<fill_query>INSERT INTO test_table_mediumf SELECT groupArraySample(1000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(100000000)) </fill_query>
<!-- LARGE version -->
<fill_query>INSERT INTO test_table_large SELECT groupArraySample(50000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(50000000)) </fill_query>
<fill_query>INSERT INTO test_table_large2 SELECT groupArraySample(50000000)(number) AS set, groupArraySample(2000)(number) AS subset FROM (SELECT * FROM numbers(50000000)) Settings max_execution_time=30 </fill_query>
<fill_query>INSERT INTO test_table_largef SELECT groupArraySample(50000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(1000000000)) </fill_query>
<query tag='SMALL_HASALL_TRUE'>select hasAll(set, subset) from test_table_small</query>
<query tag='SMALL2_HASALL_TRUE'>select hasAll(set, subset) from test_table_small2</query>
<query tag='SMALL_HASALL_FALSE'>select hasAll(set, subset) from test_table_smallf</query>
<query tag='MEDIUM_HASALL_TRUE'>select hasAll(set, subset) from test_table_medium</query>
<query tag='MEDIUM2_HASALL_TRUE'>select hasAll(set, subset) from test_table_medium2</query>
<query tag='MEDIUM_HASALL_FALSE'>select hasAll(set, subset) from test_table_mediumf</query>
<query tag='LARGE_HASALL_TRUE'>select hasAll(set, subset) from test_table_large</query>
<query tag='LARGE2_HASALL_TRUE'>select hasAll(set, subset) from test_table_large2 Settings max_execution_time=300</query>
<query tag='LARGE_HASALL_FALSE'>select hasAll(set, subset) from test_table_largef</query>
<drop_query>DROP TABLE IF EXISTS test_table_small</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_small2</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_smallf</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_medium</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_medium2</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_mediumf</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_large</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_large2</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_largef</drop_query>
</test>

View File

@ -1,52 +0,0 @@
<test>
<create_query>CREATE TABLE test_table_small (`set` Array(Int8), `subset` Array (Int8)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_small2 (`set` Array(Int8), `subset` Array (Int8)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_smallf (`set` Array(Int8), `subset` Array (Int8)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_medium (`set` Array(Int8), `subset` Array (Int8)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_medium2 (`set` Array(Int8), `subset` Array (Int8)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_mediumf (`set` Array(Int8), `subset` Array (Int8)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_large (`set` Array(Int8), `subset` Array (Int8)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_large2 (`set` Array(Int8), `subset` Array (Int8)) ENGINE = MergeTree ORDER BY set </create_query>
<create_query>CREATE TABLE test_table_largef (`set` Array(Int8), `subset` Array (Int8)) ENGINE = MergeTree ORDER BY set </create_query>
<!-- SMALL version -->
<fill_query>INSERT INTO test_table_small SELECT groupArraySample(500)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(500)) </fill_query>
<fill_query>INSERT INTO test_table_small2 SELECT groupArraySample(500)(number) AS set, groupArraySample(400)(number) AS subset FROM (SELECT * FROM numbers(500)) </fill_query>
<fill_query>INSERT INTO test_table_smallf SELECT groupArraySample(500)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(5000000)) </fill_query>
<!-- MEDIUM version -->
<fill_query>INSERT INTO test_table_medium SELECT groupArraySample(1000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(1000000)) </fill_query>
<fill_query>INSERT INTO test_table_medium2 SELECT groupArraySample(1000000)(number) AS set, groupArraySample(4000)(number) AS subset FROM (SELECT * FROM numbers(1000000)) </fill_query>
<fill_query>INSERT INTO test_table_mediumf SELECT groupArraySample(1000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(100000000)) </fill_query>
<!-- LARGE version -->
<fill_query>INSERT INTO test_table_large SELECT groupArraySample(50000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(50000000)) </fill_query>
<fill_query>INSERT INTO test_table_large2 SELECT groupArraySample(50000000)(number) AS set, groupArraySample(4000)(number) AS subset FROM (SELECT * FROM numbers(50000000)) </fill_query>
<fill_query>INSERT INTO test_table_largef SELECT groupArraySample(50000000)(number) AS set, groupArraySample(10)(number) AS subset FROM (SELECT * FROM numbers(1000000000)) </fill_query>
<query tag='SMALL_HASALL_TRUE'>select hasAll(set, subset) from test_table_small</query>
<query tag='SMALL2_HASALL_TRUE'>select hasAll(set, subset) from test_table_small2</query>
<query tag='SMALL_HASALL_FALSE'>select hasAll(set, subset) from test_table_smallf</query>
<query tag='MEDIUM_HASALL_TRUE'>select hasAll(set, subset) from test_table_medium</query>
<query tag='MEDIUM2_HASALL_TRUE'>select hasAll(set, subset) from test_table_medium2</query>
<query tag='MEDIUM_HASALL_FALSE'>select hasAll(set, subset) from test_table_mediumf</query>
<query tag='LARGE_HASALL_TRUE'>select hasAll(set, subset) from test_table_large</query>
<query tag='LARGE2_HASALL_TRUE'>select hasAll(set, subset) from test_table_large2 Settings max_execution_time=300</query>
<query tag='LARGE_HASALL_FALSE'>select hasAll(set, subset) from test_table_largef</query>
<drop_query>DROP TABLE IF EXISTS test_table_small</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_small2</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_smallf</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_medium</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_medium2</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_mediumf</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_large</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_large2</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_largef</drop_query>
</test>

View File

@ -0,0 +1,53 @@
<test>
<substitutions>
<substitution>
<name>array_type</name>
<values>
<value>Int8</value>
<value>Int16</value>
<value>Int32</value>
<value>Int64</value>
</values>
</substitution>
</substitutions>
<create_query>
CREATE TABLE test_table_small_{array_type}
(
`set` Array({array_type}),
`subset` Array ({array_type})
)
ENGINE = MergeTree ORDER BY set;
</create_query>
<create_query>
CREATE TABLE test_table_medium_{array_type}
(
`set` Array({array_type}),
`subset` Array ({array_type})
)
ENGINE = MergeTree ORDER BY set;
</create_query>
<create_query>
CREATE TABLE test_table_large_{array_type}
(
`set` Array({array_type}),
`subset` Array ({array_type})
)
ENGINE = MergeTree ORDER BY set;
</create_query>
<fill_query>INSERT INTO test_table_small_{array_type} SELECT groupArraySample(5000)(rand64()) AS set, groupArraySample(500)(rand64()) AS subset FROM numbers(10000000) GROUP BY number % 5000;</fill_query>
<fill_query>INSERT INTO test_table_medium_{array_type} SELECT groupArraySample(50000)(rand64()) AS set, groupArraySample(5000)(rand64()) AS subset FROM numbers(25000000) GROUP BY number % 50000;</fill_query>
<fill_query>INSERT INTO test_table_large_{array_type} SELECT groupArraySample(500000)(rand64()) AS set, groupArraySample(500000)(rand64()) AS subset FROM numbers(50000000) GROUP BY number % 500000;</fill_query>
<query>SELECT hasAll(set, subset) FROM test_table_small_{array_type} FORMAT Null</query>
<query>SELECT hasAll(set, subset) FROM test_table_medium_{array_type} FORMAT Null</query>
<query>SELECT hasAll(set, subset) FROM test_table_large_{array_type} FORMAT Null</query>
<drop_query>DROP TABLE IF EXISTS test_table_small_{array_type}</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_medium_{array_type}</drop_query>
<drop_query>DROP TABLE IF EXISTS test_table_large_{array_type}</drop_query>
</test>