citus/src/backend/distributed/planner
Önder Kalacı cb5eb73048
Add support for router INSERT .. SELECT commands (#7077)
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
2023-07-28 15:07:20 +03:00
..
combine_query_planner.c Prevent crashes on update with returning clauses (#6643) 2023-01-24 20:07:43 +03:00
cte_inline.c Citus Revise tree-walk APIs to include context (#6975) 2023-06-06 14:17:51 +03:00
deparse_shard_query.c Multi tenant monitoring (#6725) 2023-04-05 17:44:17 +03:00
distributed_planner.c This pull request introduces support for nonroutable merge commands in the following scenarios: 2023-06-19 12:23:40 -07:00
extended_op_node_utils.c Drop postgres 11 support 2021-03-25 09:20:28 +03:00
fast_path_router_planner.c PG16 compatibility: Resolve compilation issues (#7005) 2023-07-21 14:32:37 +03:00
function_call_delegation.c Citus UDFs support for single shard tables (#6916) 2023-05-26 17:30:05 +03:00
insert_select_planner.c Add support for router INSERT .. SELECT commands (#7077) 2023-07-28 15:07:20 +03:00
intermediate_result_pruning.c Rename insert-select redistribute code base to generic purpose 2023-06-01 09:43:43 -07:00
local_distributed_join_planner.c This pull request introduces support for nonroutable merge commands in the following scenarios: 2023-06-19 12:23:40 -07:00
local_plan_cache.c Remove useless version compats 2022-07-29 10:31:55 +02:00
merge_planner.c In the MERGE join clause, there is a datatype mismatch between target's distribution column 2023-07-27 16:06:00 -07:00
multi_explain.c Drop PG13 Support Phase 2 - Remove PG13 specific paths/tests (#7007) 2023-06-21 14:18:23 +03:00
multi_join_order.c In the MERGE join clause, there is a datatype mismatch between target's distribution column 2023-07-27 16:06:00 -07:00
multi_logical_optimizer.c Drop PG13 Support Phase 2 - Remove PG13 specific paths/tests (#7007) 2023-06-21 14:18:23 +03:00
multi_logical_planner.c In the MERGE join clause, there is a datatype mismatch between target's distribution column 2023-07-27 16:06:00 -07:00
multi_physical_planner.c Optimize QueryPushdownSqlTaskList on memory and cpu (#6945) 2023-06-16 16:06:22 +02:00
multi_router_planner.c Expand EnableNonColocatedRouterQueryPushdown to cover shard colocation (e.g., shard index) (#7076) 2023-07-25 16:20:13 +03:00
planner_readme.md Fix some more master->coordinator comments 2020-07-07 10:37:53 +02:00
query_colocation_checker.c PG16 compatibility: Resolve compilation issues (#7005) 2023-07-21 14:32:37 +03:00
query_pushdown_planning.c 1) Restrict MERGE command INSERT to the source's distribution column 2023-03-16 13:43:08 -07:00
recursive_planning.c This pull request introduces support for nonroutable merge commands in the following scenarios: 2023-06-19 12:23:40 -07:00
relation_restriction_equivalence.c Drop PG13 Support Phase 2 - Remove PG13 specific paths/tests (#7007) 2023-06-21 14:18:23 +03:00
shard_pruning.c Replace CITUS_TABLE_WITH_NO_DIST_KEY checks with HasDistributionKey() (#6743) 2023-03-10 13:55:52 +03:00
tdigest_extension.c adapt recently added code for pg13 2020-08-04 15:18:27 +03:00