diff --git a/tests/performance/join_set_filter.xml b/tests/performance/join_set_filter.xml new file mode 100644 index 00000000000..cb493fb435b --- /dev/null +++ b/tests/performance/join_set_filter.xml @@ -0,0 +1,46 @@ + + + + table_size + + 100000000 + + + + + + 100000 + full_sorting_merge + + + + CREATE TABLE t1 (x UInt64, y UInt64) ENGINE = MergeTree ORDER BY y + AS SELECT + sipHash64(number, 't1_x') % {table_size} AS x, + sipHash64(number, 't1_y') % {table_size} AS y + FROM numbers({table_size}) + + + + CREATE TABLE t2 (x UInt64, y UInt64) ENGINE = MergeTree ORDER BY y + AS SELECT + sipHash64(number, 't2_x') % {table_size} AS x, + sipHash64(number, 't2_y') % {table_size} AS y + FROM numbers({table_size}) + + + SELECT * FROM t1 JOIN t2 ON t1.x = t2.x WHERE less(t1.y, 10000) + SELECT * FROM t2 JOIN t1 ON t1.x = t2.x WHERE less(t1.y, 10000) + + SELECT * FROM t1 JOIN t2 ON t1.x = t2.x WHERE greater(t1.y, {table_size} - 10000) + SELECT * FROM t2 JOIN t1 ON t1.x = t2.x WHERE greater(t1.y, {table_size} - 10000) + + SELECT * FROM t1 JOIN t2 ON t1.x = t2.x WHERE t1.y % 100 = 0 + SELECT * FROM t2 JOIN t1 ON t1.x = t2.x WHERE t1.y % 100 = 0 + + SELECT * FROM t1 JOIN t2 ON t1.x = t2.x WHERE t1.y % 1000 = 0 + SELECT * FROM t2 JOIN t1 ON t1.x = t2.x WHERE t1.y % 1000 = 0 + + DROP TABLE IF EXISTS t1 + DROP TABLE IF EXISTS t2 +