Skip to content

Instantly share code, notes, and snippets.

@inv2004
Last active September 5, 2019 17:57
Show Gist options
  • Save inv2004/66ba00541c7dcf502a24d420c6538317 to your computer and use it in GitHub Desktop.
Save inv2004/66ba00541c7dcf502a24d420c6538317 to your computer and use it in GitHub Desktop.
<test>
<!-- clickhouse performance-test --lite --input-file simple_insert.xml -->
<name>simple_insert</name>
<type>loop</type>
<stop_conditions>
<all_of>
<total_time_ms>30000</total_time_ms>
</all_of>
<any_of>
<average_speed_not_changing_for_ms>6000</average_speed_not_changing_for_ms>
<total_time_ms>60000</total_time_ms>
</any_of>
</stop_conditions>
<main_metric>
<queries_per_second />
<min_time />
</main_metric>
<substitutions>
<substitution>
<name>table_name</name>
<values>
<value>perf_simple_insert</value>
</values>
</substitution>
<substitution>
<name>rows</name>
<values>
<value>1000000</value>
</values>
</substitution>
</substitutions>
<create_query>
CREATE TABLE perf_simple_insert (
dt DateTime,
c1 UInt64,
c2 UInt64,
c3 UInt64,
c4 UInt64,
c5 UInt64
)
ENGINE = MergeTree()
ORDER BY (dt, c1, c2, c3, c4, c5)
PARTITION BY toYYYYMM(dt);
</create_query>
<create_query>
CREATE TABLE perf_simple_insert_buf AS perf_simple_insert ENGINE = Buffer(default, peft_simple_insert, 16, 10, 100, 10000, 1000000, 10000000, 100000000)
</create_query>
<create_query>SYSTEM STOP MERGES {table_name}</create_query>
<query>
INSERT INTO {table_name} SELECT toDateTime('2019-01-01 00:00:00')+n, number as n, n*10, n*100, n*1000, n*10000 numer FROM system.numbers LIMIT {rows}
</query>
<drop_query>DROP TABLE IF EXISTS perf_simple_insert_buf</drop_query>
<drop_query>DROP TABLE IF EXISTS perf_simple_insert</drop_query>
<drop_query>SYSTEM START MERGES {table_name}</drop_query>
</test>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment