add 02241_join_rocksdb

This commit is contained in:
vdimir 2022-03-17 12:52:55 +00:00
parent 51a6c347ad
commit ad06dd3fe9
No known key found for this signature in database
GPG Key ID: 6EE4CE2BEDC51862
2 changed files with 75 additions and 0 deletions

View File

@ -0,0 +1,34 @@
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1
1

View File

@ -0,0 +1,41 @@
SET join_algorithm = 'direct';
{% for table_size in [10, 65555, 100000] -%}
CREATE OR REPLACE TABLE rdb (key UInt64, value String) ENGINE = EmbeddedRocksDB PRIMARY KEY (key);
INSERT INTO rdb SELECT (sipHash64(number) % {{ table_size }}) as key, ('val' || toString(key)) as value FROM numbers_mt({{ table_size }});
{% for block_size in [10, 11, 128, 129, 65505, 65506, 70000] -%}
{% if block_size * 5000 > table_size -%}
SET max_block_size = {{ block_size }};
SELECT count() == (SELECT count() FROM rdb WHERE key < {{ table_size // 2 }})
FROM (SELECT number as k FROM numbers_mt({{ table_size // 2 }})) as t1
INNER JOIN rdb
ON rdb.key == t1.k;
SELECT count() == (SELECT count() FROM rdb WHERE key < {{ table_size + table_size // 4 + 1 }})
FROM (SELECT number as k FROM numbers_mt({{ table_size + table_size // 4 + 1 }})) as t1
INNER JOIN rdb
ON rdb.key == t1.k;
{% endif -%}
{% endfor -%}
{% endfor -%}
SELECT count()
FROM (SELECT number as k FROM numbers_mt(10)) as t1
INNER JOIN rdb
ON rdb.key + 1 == t1.k; -- { serverError UNSUPPORTED_METHOD }
SELECT count()
FROM (SELECT number as k FROM numbers_mt(10)) as t1
INNER JOIN (SELECT * FROM rdb) AS rdb
ON rdb.key == t1.k; -- { serverError UNSUPPORTED_METHOD }
DROP TABLE rdb;