2020-02-19 13:10:03 +00:00
|
|
|
SET join_algorithm = 'hash';
|
2019-10-15 16:31:49 +00:00
|
|
|
|
2023-02-20 18:26:39 +00:00
|
|
|
SELECT n, j FROM (SELECT number as n FROM numbers(4)) nums
|
2019-10-15 16:31:49 +00:00
|
|
|
ANY LEFT JOIN (
|
|
|
|
SELECT number * 2 AS n, number + 10 AS j
|
|
|
|
FROM numbers(4000)
|
|
|
|
) js2
|
2022-06-18 19:29:58 +00:00
|
|
|
USING n
|
|
|
|
ORDER BY n;
|
2019-10-15 16:31:49 +00:00
|
|
|
|
|
|
|
SET max_rows_in_join = 1000;
|
|
|
|
|
2023-02-20 18:26:39 +00:00
|
|
|
SELECT n, j FROM (SELECT number AS n FROM numbers(4)) nums
|
2019-10-15 16:31:49 +00:00
|
|
|
ANY LEFT JOIN (
|
|
|
|
SELECT number * 2 AS n, number + 10 AS j
|
|
|
|
FROM numbers(4000)
|
|
|
|
) js2
|
2022-06-18 19:29:58 +00:00
|
|
|
USING n
|
|
|
|
ORDER BY n; -- { serverError 191 }
|
2019-10-15 16:31:49 +00:00
|
|
|
|
2020-02-19 13:10:03 +00:00
|
|
|
SET join_algorithm = 'partial_merge';
|
2019-10-15 16:31:49 +00:00
|
|
|
|
2023-02-20 18:26:39 +00:00
|
|
|
SELECT n, j FROM (SELECT number as n FROM numbers(4)) nums
|
2019-10-15 16:31:49 +00:00
|
|
|
ANY LEFT JOIN (
|
|
|
|
SELECT number * 2 AS n, number + 10 AS j
|
|
|
|
FROM numbers(4000)
|
|
|
|
) js2
|
2022-06-18 19:29:58 +00:00
|
|
|
USING n
|
|
|
|
ORDER BY n;
|
2019-10-15 16:31:49 +00:00
|
|
|
|
|
|
|
SET partial_merge_join_optimizations = 1;
|
|
|
|
|
2023-02-20 18:26:39 +00:00
|
|
|
SELECT n, j FROM (SELECT number AS n FROM numbers(4)) nums
|
2019-10-15 16:31:49 +00:00
|
|
|
ANY LEFT JOIN (
|
|
|
|
SELECT number * 2 AS n, number + 10 AS j
|
|
|
|
FROM numbers(4000)
|
|
|
|
) js2
|
2022-06-18 19:29:58 +00:00
|
|
|
USING n
|
|
|
|
ORDER BY n;
|
2020-02-19 13:10:03 +00:00
|
|
|
|
|
|
|
SET join_algorithm = 'auto';
|
|
|
|
|
2023-02-20 18:26:39 +00:00
|
|
|
SELECT n, j FROM (SELECT number AS n FROM numbers(4)) nums
|
2020-02-19 13:10:03 +00:00
|
|
|
ANY LEFT JOIN (
|
|
|
|
SELECT number * 2 AS n, number + 10 AS j
|
|
|
|
FROM numbers(4000)
|
|
|
|
) js2
|
2022-06-18 19:29:58 +00:00
|
|
|
USING n
|
|
|
|
ORDER BY n;
|
|
|
|
|
|
|
|
SET max_rows_in_join = '10';
|
|
|
|
|
2023-02-20 18:26:39 +00:00
|
|
|
SELECT n, j FROM (SELECT number AS n FROM numbers(4)) nums
|
2022-06-18 19:29:58 +00:00
|
|
|
ANY LEFT JOIN (
|
|
|
|
SELECT number * 2 AS n, number + 10 AS j
|
|
|
|
FROM numbers(4000)
|
|
|
|
) js2
|
|
|
|
USING n
|
|
|
|
ORDER BY n;
|