Skip to main content

Optimized merge with composite primary key

  • May 25, 2016
  • 1 reply
  • 11 views

BryanChapman

Is it possible to execute an optimized merge with multiple columns in on clause where the target table has a composite key?

 

Something similar to 


MERGE INTO table1 t1 USING table2 t2 on (t1.col1 = t2.col1 and t1.col2 = t2.col2)
WHEN MATCHED THEN UPDATE SET col1 = t2.col1, col2 = t2.col2


where t1 has a primary key defined as CONSTRAINT composite_pk PRIMARY KEY (col1, col2)

 

https://my.vertica.com/docs/7.1.x/HTML/Content/Authoring/AdministratorsGuide/Tables/OptimizedVsNonOptimizedMerge.htm

1 reply

FiliN
Forum|alt.badge.img
  • Participating Frequently
  • May 29, 2016

Yes. It is possible absolutly