How it works...

Merge statements combine update and insert statements into one; rows, when matched, can be deleted or updated, and non-matched rows are simply inserted.

Assume that both tables have the same unique primary index and contain 1 million rows.

An update is a very CPU or I/O intensive operator, as rows need to be modified, and if needed a table will be redistributed based on new values. 

Get Teradata Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.