How it works...

As we know, there are two types of tables in Teradata, SET and MULTISET tables, and the main difference between these tables is a SET table doesn't allow duplicate rows whereas a MULTISET table allows it. When we don't specify any option by default, Teradata creates a SET table. You need to specify in DDL if you need a MULTISET table:

/*MultiSet table*/CREATE MULTISET TABLE td_cookbook.EMP_TBL_MULTI
(EMP_ID INTEGER ,
EMP_Name VARCHAR(20),
Sal INTEGER)primary index (EMP_ID)

A SET table does not allow duplicate rows, hence for every new row inserted or updated in the table, Teradata checks the violation of uniqueness constraint for each new row (inserted or updated); this is called duplicate row checking, which is overhead ...

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.