ClickHouse/tests/performance/lightweight_delete.xml
Alexander Gololobov 594195451e Cleanups
2022-07-24 12:21:18 +02:00

36 lines
939 B
XML

<test>
<create_query>
CREATE TABLE lwd_test (
id UInt64,
value String,
) ENGINE=MergeTree() ORDER BY id;
</create_query>
<!-- Fill the table with relatively big values -->
<fill_query>
INSERT INTO lwd_test SELECT number, randomString(100) FROM system.numbers LIMIT 10000000;
</fill_query>
<fill_query>
OPTIMIZE TABLE lwd_test FINAL;
</fill_query>
<settings>
<max_threads>1</max_threads>
<mutations_sync>1</mutations_sync>
<allow_experimental_lightweight_delete>1</allow_experimental_lightweight_delete>
</settings>
<!-- delete most of the rows -->
<fill_query>
DELETE FROM lwd_test WHERE id &lt; 9999999;
</fill_query>
<!-- get the first remaining row -->
<query>SELECT id, length(value) FROM lwd_test ORDER BY id LIMIT 1</query>
<drop_query>DROP TABLE lwd_test</drop_query>
</test>