How it works...

Let's take an example where we insert rows into a table and the statistics of PI are missing. We will see that the number of rows estimated is equal to the number of AMPs on our system:

Number of AMPS: 400INSERT INTO cookbook_scratch.dw_PI ( main_addnl_type , cre_ts , upd_ts ) 
SELECT                                    card_main_addnl_type , CURRENT_TIMESTAMP( 0 ) , NULL 
FROM    pcookbook_scratch.dw_PI_source ;

Now, let's check for the INSERT statement:

Before Statswhich is duplicated on the AMPsThe size is estimated with high confidence to be400 rows.  The estimated time for this step is 0.02 seconds.

The estimated number of rows is 400, and as we can see from the explanation, rows are getting duplicated. On a 400 AMP system, if we duplicate one row, estimation ...

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.