How to do it...

  1. Hit F6 by selecting the query to get the explain or write the EXPLAIN keyword before the query and press F5:
ExplainInsert  Into  test01.webclicks select * From    au.az_clicks;
  1. First, we lock a distinct test01."pseudo table" for write on a RowHash to prevent global deadlock for test01.webclicks.
  2. Next, we lock a distinct au."pseudo table" for read on a RowHash to prevent global deadlock for au.az_clicks.
  3. We lock test01.webclicks for write, and we lock au.az_clicks for read.
  4. We do an all-AMPs RETRIEVE step from au.az_clicks by way of an all-rows scan with no residual conditions into Spool 1 (all_AMPs)which is built locally on the AMPs. The input table will not be cached in memory, but it is eligible for synchronized scanning ...

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.