Using MERGE in TRINO over Target Partition

240 Views Asked by At

While using MERGE statement in Trino-Icerberg ; one of the big table takes lots of time. reason it reads whole TARGET table to evaluate the search condition (ON source.col = target.col)

-- is there a way this scanning can be limited to recent partitions (days)

TRIED finding in standard docs but could not find anything as partition specific MERGE https://www.starburst.io/blog/apache-iceberg-dml-update-delete-merge-maintenance-in-trino/

1

There are 1 best solutions below

0
Yuri Niitsuma On

Put your partitions too on your ON conditions:

Ex:

ON source.col = target.col AND source.create_date = target.create_date