ClickHouse/tests/performance/lightweight_delete.xml

36 lines
939 B
XML
Raw Normal View History

<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>
2022-07-21 19:50:19 +00:00
<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>