citus/src/backend/distributed
Teja Mupparti fa7b8949a8 This implements MERGE phase3
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;
2023-01-24 17:44:21 -08:00
..
clock Address the issues/comments from the original PR# 6315 2022-12-05 11:06:21 -08:00
commands Enable adding FOREIGN KEY constraints on Citus tables without a name. (#6616) 2023-01-20 01:43:52 +03:00
connection This implements a new UDF citus_get_cluster_clock() that returns a monotonically 2022-10-28 10:15:08 -07:00
deparser Enable adding FOREIGN KEY constraints on Citus tables without a name. (#6616) 2023-01-20 01:43:52 +03:00
executor Do not create additional WaitEventSet for RemoteSocketClosed checks 2022-12-14 22:42:55 +01:00
metadata Identity Column Support on Citus Managed Tables (#6591) 2023-01-19 15:45:41 +03:00
operations Identity Column Support on Citus Managed Tables (#6591) 2023-01-19 15:45:41 +03:00
planner This implements MERGE phase3 2023-01-24 17:44:21 -08:00
progress Add status column to get_rebalance_progress() (#6403) 2022-10-17 16:55:31 +03:00
relay Drop postgres 12 support (#6040) 2022-07-20 17:49:36 +03:00
replication Quote all identifiers that we use for logical replication (#6604) 2023-01-06 14:12:03 +00:00
shardsplit Introduce code changes to fix Issue:6303 (#6328) 2022-09-14 19:56:32 +05:30
sql Remove shardstate from placement insert functions (#6615) 2023-01-18 09:52:38 +01:00
test Remove shardstate leftovers (#6627) 2023-01-19 11:43:58 +03:00
transaction Make GPIDs work with pg_dist_poolinfo (#6588) 2023-01-13 14:39:19 +00:00
utils Identity Column Support on Citus Managed Tables (#6591) 2023-01-19 15:45:41 +03:00
worker Drop SHARD_STATE_TO_DELETE (#6494) 2023-01-03 14:38:16 +03:00
.gitignore Change SQL migration build process for easier reviews (#2951) 2019-09-13 18:44:27 +02:00
Makefile This implements a new UDF citus_get_cluster_clock() that returns a monotonically 2022-10-28 10:15:08 -07:00
citus--11.1-1.control Support citus_columnar as separate extension (#5911) 2022-07-13 21:08:29 -07:00
citus.control Bump Citus to 11.2devel (#6385) 2022-09-30 14:47:42 +03:00
safeclib Compile safestringlib using regular configure 2020-03-19 11:52:20 +01:00
shared_library_init.c Make GPIDs work with pg_dist_poolinfo (#6588) 2023-01-13 14:39:19 +00:00