ClickHouse/tests/performance/hashed_dictionary.xml

146 lines
4.8 KiB
XML
Raw Normal View History

<test>
<substitutions>
<substitution>
<name>column_name</name>
<values>
<value>'value_int'</value>
<value>'value_string'</value>
<value>'value_decimal'</value>
<value>'value_string_nullable'</value>
</values>
</substitution>
<substitution>
<name>elements_count</name>
<values>
<value>5000000</value>
<value>7500000</value>
</values>
</substitution>
<substitution>
<name>layout_suffix</name>
<values>
<value>HASHED</value>
<value>SPARSE_HASHED</value>
</values>
</substitution>
</substitutions>
2021-03-27 14:00:00 +00:00
<create_query>
CREATE TABLE simple_key_dictionary_source_table
2021-03-27 14:00:00 +00:00
(
id UInt64,
value_int UInt64,
value_string String,
value_decimal Decimal64(8),
value_string_nullable Nullable(String)
) ENGINE = Memory
2021-03-27 14:00:00 +00:00
</create_query>
<create_query>
CREATE TABLE complex_key_dictionary_source_table
2021-03-27 14:00:00 +00:00
(
id UInt64,
id_key String,
value_int UInt64,
value_string String,
value_decimal Decimal64(8),
value_string_nullable Nullable(String)
) ENGINE = Memory
2021-03-27 14:00:00 +00:00
</create_query>
<create_query>
CREATE DICTIONARY IF NOT EXISTS simple_key_{layout_suffix}_dictionary
2021-03-27 14:00:00 +00:00
(
id UInt64,
value_int UInt64,
value_string String,
value_decimal Decimal64(8),
value_string_nullable Nullable(String)
)
PRIMARY KEY id
SOURCE(CLICKHOUSE(TABLE 'simple_key_dictionary_source_table'))
LAYOUT({layout_suffix}())
LIFETIME(0)
2021-03-27 14:00:00 +00:00
</create_query>
<create_query>
CREATE DICTIONARY IF NOT EXISTS complex_key_{layout_suffix}_dictionary
2021-03-27 14:00:00 +00:00
(
id UInt64,
id_key String,
value_int UInt64,
value_string String,
value_decimal Decimal64(8),
value_string_nullable Nullable(String)
)
PRIMARY KEY id, id_key
SOURCE(CLICKHOUSE(TABLE 'complex_key_dictionary_source_table'))
LAYOUT(COMPLEX_KEY_{layout_suffix}())
LIFETIME(0)
2021-03-27 14:00:00 +00:00
</create_query>
<fill_query>
INSERT INTO simple_key_dictionary_source_table
2021-03-27 14:00:00 +00:00
SELECT number, number, toString(number), toDecimal64(number, 8), toString(number)
FROM system.numbers
LIMIT 5000000
2021-03-27 14:00:00 +00:00
</fill_query>
<fill_query>
INSERT INTO complex_key_dictionary_source_table
2021-03-27 14:00:00 +00:00
SELECT number, toString(number), number, toString(number), toDecimal64(number, 8), toString(number)
FROM system.numbers
LIMIT 5000000
2021-03-28 10:35:26 +00:00
</fill_query>
2021-03-27 14:00:00 +00:00
<fill_query>SYSTEM RELOAD DICTIONARY simple_key_{layout_suffix}_dictionary</fill_query>
<fill_query>SYSTEM RELOAD DICTIONARY complex_key_{layout_suffix}_dictionary</fill_query>
2021-03-27 14:00:00 +00:00
<query>SYSTEM RELOAD DICTIONARY simple_key_{layout_suffix}_dictionary</query>
<query>SYSTEM RELOAD DICTIONARY complex_key_{layout_suffix}_dictionary</query>
2021-03-27 14:00:00 +00:00
2021-03-29 13:41:03 +00:00
<query>
2021-04-13 12:57:11 +00:00
WITH rand64() % toUInt64({elements_count}) as key
SELECT dictGet('default.simple_key_{layout_suffix}_dictionary', {column_name}, key)
2021-03-29 13:41:03 +00:00
FROM system.numbers
LIMIT {elements_count}
FORMAT Null
2021-03-29 13:41:03 +00:00
</query>
2021-10-23 12:01:30 +00:00
2021-04-13 12:57:11 +00:00
<query>
WITH rand64() % toUInt64({elements_count}) as key
SELECT dictHas('default.simple_key_{layout_suffix}_dictionary', key)
2021-03-29 13:41:03 +00:00
FROM system.numbers
LIMIT {elements_count}
FORMAT Null
2021-03-29 13:41:03 +00:00
</query>
2021-03-27 14:00:00 +00:00
<query>SELECT * FROM simple_key_{layout_suffix}_dictionary FORMAT Null</query>
2021-03-29 13:41:03 +00:00
<query>
2021-04-13 12:57:11 +00:00
WITH (rand64() % toUInt64({elements_count}), toString(rand64() % toUInt64({elements_count}))) as key
SELECT dictGet('default.complex_key_{layout_suffix}_dictionary', {column_name}, key)
2021-03-29 13:41:03 +00:00
FROM system.numbers
LIMIT {elements_count}
FORMAT Null
2021-03-29 13:41:03 +00:00
</query>
2021-10-23 12:01:30 +00:00
2021-04-13 12:57:11 +00:00
<query>
WITH (rand64() % toUInt64({elements_count}), toString(rand64() % toUInt64({elements_count}))) as key
SELECT dictHas('default.complex_key_{layout_suffix}_dictionary', key)
2021-03-31 21:12:21 +00:00
FROM system.numbers
LIMIT {elements_count}
FORMAT Null
</query>
<query>SELECT * FROM complex_key_{layout_suffix}_dictionary FORMAT Null</query>
2021-03-28 10:35:26 +00:00
<drop_query>DROP TABLE IF EXISTS simple_key_dictionary_source_table</drop_query>
<drop_query>DROP TABLE IF EXISTS complex_key_dictionary_source_table</drop_query>
2021-03-28 10:35:26 +00:00
<drop_query>DROP DICTIONARY IF EXISTS simple_key_{layout_suffix}_dictionary</drop_query>
<drop_query>DROP DICTIONARY IF EXISTS complex_key_{layout_suffix}_dictionary</drop_query>
2021-03-27 14:00:00 +00:00
</test>