ClickHouse/tests/queries/0_stateless/02241_join_rocksdb_bs.sql.j2

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

45 lines
1.3 KiB
Plaintext
Raw Normal View History

2022-03-23 16:10:50 +00:00
-- Tags: use-rocksdb, long
2022-03-21 15:02:52 +00:00
SET join_algorithm = 'direct';
{% for table_size in [10, 65555, 100000] -%}
2022-03-22 16:33:03 +00:00
DROP TABLE IF EXISTS rdb_{{ table_size }};
{% endfor -%}
2022-03-21 15:02:52 +00:00
2022-03-22 16:33:03 +00:00
{% for table_size in [10, 65555, 100000] -%}
2022-03-21 15:02:52 +00:00
2022-03-22 16:33:03 +00:00
CREATE TABLE rdb_{{ table_size }} (key UInt64, value String) ENGINE = EmbeddedRocksDB PRIMARY KEY (key);
INSERT INTO rdb_{{ table_size }}
SELECT (sipHash64(number) % {{ table_size }}) as key, ('val' || toString(key)) AS value
FROM numbers_mt({{ table_size }});
2022-03-21 15:02:52 +00:00
{% for block_size in [10, 11, 128, 129, 65505, 65506, 70000] -%}
{% if block_size * 5000 > table_size -%}
SET max_block_size = {{ block_size }};
{% for right_size in [table_size // 2, table_size + table_size // 4 + 1] -%}
2022-03-22 16:33:03 +00:00
SELECT count() == (SELECT count() FROM rdb_{{ table_size }} WHERE key < {{ right_size }})
2022-03-21 15:02:52 +00:00
FROM (SELECT number as k FROM numbers_mt({{ right_size }})) as t1
2022-03-22 16:33:03 +00:00
INNER JOIN rdb_{{ table_size }} as rdb
2022-03-21 15:02:52 +00:00
ON rdb.key == t1.k;
2022-03-22 16:33:03 +00:00
SELECT count() == {{ right_size }} and countIf(value != '') == (SELECT count() FROM rdb_{{ table_size }} WHERE key < {{ right_size }})
2022-03-21 15:02:52 +00:00
FROM (SELECT number as k FROM numbers_mt({{ right_size }})) as t1
2022-03-22 16:33:03 +00:00
LEFT JOIN rdb_{{ table_size }} as rdb
2022-03-21 15:02:52 +00:00
ON rdb.key == t1.k;
{% endfor -%}
{% endif -%}
{% endfor -%}
{% endfor -%}
2022-03-22 16:33:03 +00:00
{% for table_size in [10, 65555, 100000] -%}
DROP TABLE IF EXISTS rdb_{{ table_size }};
{% endfor -%}
2022-03-21 15:02:52 +00:00