add parallel_replicas_prefer_local_join

This commit is contained in:
Nikita Taranov 2024-11-04 17:31:39 +01:00
parent 9583357662
commit 24017bb7ad
2 changed files with 77 additions and 15 deletions

View File

@ -56,3 +56,61 @@ SELECT `__table1`.`item_id` AS `item_id` FROM `default`.`t1` AS `__table1` GROUP
500030000
500040000
SELECT sum(`__table1`.`item_id`) AS `sum(item_id)` FROM (SELECT `__table2`.`item_id` AS `item_id`, `__table2`.`price_sold` AS `price_sold` FROM `default`.`t` AS `__table2`) AS `__table1` ALL LEFT JOIN (SELECT `__table4`.`item_id` AS `item_id` FROM `default`.`t1` AS `__table4`) AS `__table3` ON `__table1`.`item_id` = `__table3`.`item_id` GROUP BY `__table1`.`price_sold` ORDER BY `__table1`.`price_sold` ASC
4999950000
4999950000
SELECT `__table1`.`item_id` AS `item_id` FROM `default`.`t` AS `__table1` GROUP BY `__table1`.`item_id`
SELECT `__table1`.`item_id` AS `item_id` FROM `default`.`t1` AS `__table1`
4999950000
4999950000
SELECT `__table1`.`item_id` AS `item_id` FROM `default`.`t` AS `__table1`
SELECT `__table1`.`item_id` AS `item_id` FROM `default`.`t1` AS `__table1` GROUP BY `__table1`.`item_id`
499950000
499960000
499970000
499980000
499990000
500000000
500010000
500020000
500030000
500040000
499950000
499960000
499970000
499980000
499990000
500000000
500010000
500020000
500030000
500040000
SELECT sum(`__table1`.`item_id`) AS `sum(item_id)` FROM (SELECT `__table2`.`item_id` AS `item_id`, `__table2`.`price_sold` AS `price_sold` FROM `default`.`t` AS `__table2`) AS `__table1` GLOBAL ALL LEFT JOIN `_data_4551627371769371400_3093038500622465792` AS `__table3` ON `__table1`.`item_id` = `__table3`.`item_id` GROUP BY `__table1`.`price_sold` ORDER BY `__table1`.`price_sold` ASC
4999950000
4999950000
SELECT `__table1`.`item_id` AS `item_id` FROM `default`.`t` AS `__table1` GROUP BY `__table1`.`item_id`
SELECT `__table1`.`item_id` AS `item_id` FROM `default`.`t1` AS `__table1`
4999950000
4999950000
SELECT `__table1`.`item_id` AS `item_id` FROM `default`.`t` AS `__table1`
SELECT `__table1`.`item_id` AS `item_id` FROM `default`.`t1` AS `__table1` GROUP BY `__table1`.`item_id`
499950000
499960000
499970000
499980000
499990000
500000000
500010000
500020000
500030000
500040000
499950000
499960000
499970000
499980000
499990000
500000000
500010000
500020000
500030000
500040000
SELECT sum(`__table1`.`item_id`) AS `sum(item_id)` FROM (SELECT `__table2`.`item_id` AS `item_id`, `__table2`.`price_sold` AS `price_sold` FROM `default`.`t` AS `__table2`) AS `__table1` GLOBAL ALL LEFT JOIN `_data_4551627371769371400_3093038500622465792` AS `__table3` ON `__table1`.`item_id` = `__table3`.`item_id` GROUP BY `__table1`.`price_sold` ORDER BY `__table1`.`price_sold` ASC

View File

@ -75,23 +75,27 @@ query3="
ORDER BY price_sold
"
for prefer_local_plan in {0..1}; do
for query in "${query1}" "${query2}" "${query3}"; do
for enable_parallel_replicas in {0..1}; do
${CLICKHOUSE_CLIENT} --query="
set enable_analyzer=1;
set parallel_replicas_local_plan=${prefer_local_plan};
set allow_experimental_parallel_reading_from_replicas=${enable_parallel_replicas}, cluster_for_parallel_replicas='parallel_replicas', max_parallel_replicas=100, parallel_replicas_for_non_replicated_merge_tree=1;
for parallel_replicas_prefer_local_join in 1 0; do
for prefer_local_plan in {0..1}; do
for query in "${query1}" "${query2}" "${query3}"; do
for enable_parallel_replicas in {0..1}; do
${CLICKHOUSE_CLIENT} --query="
set enable_analyzer=1;
set parallel_replicas_prefer_local_join=${parallel_replicas_prefer_local_join};
set parallel_replicas_local_plan=${prefer_local_plan};
set allow_experimental_parallel_reading_from_replicas=${enable_parallel_replicas}, cluster_for_parallel_replicas='parallel_replicas', max_parallel_replicas=100, parallel_replicas_for_non_replicated_merge_tree=1;
${query};
--SELECT '----- enable_parallel_replicas=$enable_parallel_replicas prefer_local_plan=$prefer_local_plan parallel_replicas_prefer_local_join=$parallel_replicas_prefer_local_join -----';
${query};
SELECT replaceRegexpAll(explain, '.*Query: (.*) Replicas:.*', '\\1')
FROM
(
EXPLAIN actions=1 ${query}
)
WHERE explain LIKE '%ParallelReplicas%';
"
SELECT replaceRegexpAll(explain, '.*Query: (.*) Replicas:.*', '\\1')
FROM
(
EXPLAIN actions=1 ${query}
)
WHERE explain LIKE '%ParallelReplicas%';
"
done
done
done
done