mirror of https://github.com/citusdata/citus.git
Tradionally our planner works in the following order: router - > pushdown -> repartition -> pull to coordinator However, for INSERT .. SELECT commands, we did not support "router". In practice, that is not a big issue, because pushdown planning can handle router case as well. However, with PG 16, certain outer joins are converted to JOIN without any conditions (e.g., JOIN .. ON (true)) and the filters are pushed down to the tables. When the filters are pushed down to the tables, router planner can detect. However, pushdown planner relies on JOIN conditions. An example query: ``` INSERT INTO agg_events (user_id) SELECT raw_events_first.user_id FROM raw_events_first LEFT JOIN raw_events_second ON raw_events_first.user_id = raw_events_second.user_id WHERE raw_events_first.user_id = 10; ``` As a side effect of this change, now we can also relax certain limitation that "pushdown" planner emposes, but not "router". So, with this PR, we also allow those. Closes https://github.com/citusdata/citus/pull/6772 DESCRIPTION: Prevents unnecessarily pulling the data into coordinator for some INSERT .. SELECT queries that target a single-shard group |
||
---|---|---|
.. | ||
combine_query_planner.c | ||
cte_inline.c | ||
deparse_shard_query.c | ||
distributed_planner.c | ||
extended_op_node_utils.c | ||
fast_path_router_planner.c | ||
function_call_delegation.c | ||
insert_select_planner.c | ||
intermediate_result_pruning.c | ||
local_distributed_join_planner.c | ||
local_plan_cache.c | ||
merge_planner.c | ||
multi_explain.c | ||
multi_join_order.c | ||
multi_logical_optimizer.c | ||
multi_logical_planner.c | ||
multi_physical_planner.c | ||
multi_router_planner.c | ||
planner_readme.md | ||
query_colocation_checker.c | ||
query_pushdown_planning.c | ||
recursive_planning.c | ||
relation_restriction_equivalence.c | ||
shard_pruning.c | ||
tdigest_extension.c |