mirror of https://github.com/citusdata/citus.git
Support pushdown query where all the tables in the merge-sql are Citus-distributed, co-located, and both the source and target relations are joined on the distribution column. This will generate multiple tasks which execute independently after pushdown. SELECT create_distributed_table('t1', 'id'); SELECT create_distributed_table('s1', 'id', colocate_with => ‘t1’); MERGE INTO t1 USING s1 ON t1.id = s1.id WHEN MATCHED THEN UPDATE SET val = s1.val + 10 WHEN MATCHED THEN DELETE WHEN NOT MATCHED THEN INSERT (id, val, src) VALUES (s1.id, s1.val, s1.src) *The only exception for both the phases II and III is, UPDATEs and INSERTs must be done on the same shard-group as the joined key; for example, below scenarios are NOT supported as the key-value to be inserted/updated is not guaranteed to be on the same node as the id distribution-column. MERGE INTO target t USING source s ON (t.customer_id = s.customer_id) WHEN NOT MATCHED THEN - - INSERT(customer_id, …) VALUES (<non-local-constant-key-value>, ……); OR this scenario where we update the distribution column itself MERGE INTO target t USING source s On (t.customer_id = s.customer_id) WHEN MATCHED THEN UPDATE SET customer_id = 100; |
||
---|---|---|
.. | ||
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 | ||
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 |