jacktby jacktby
08/10/2023, 12:43 PMTom van Bussel
08/10/2023, 1:33 PMjacktby jacktby
08/10/2023, 1:47 PMTom van Bussel
08/10/2023, 1:48 PMMERGE INTO orders t
USING order_mutations s
ON t.date = s.date AND t.id = s.id
WHEN MATCHED THEN UPDATE SET *
WHEN NOT MATCHED THEN INSERT *
orders
is clustered (partitioned or z-ordered) by date
. And suppose that order_mutations
only contains very recent dates.targetOnlyPredicates
(which is empty) then we would have to rewrite all files in the target table. But by joining with the source we can figure out that we only have to rewrite a small subset of the files in the target table.jacktby jacktby
08/10/2023, 1:52 PMTom van Bussel
08/10/2023, 1:52 PMmerge_option
?jacktby jacktby
08/10/2023, 1:52 PMTom van Bussel
08/10/2023, 1:53 PMjacktby jacktby
08/10/2023, 1:58 PM