How to do it...

The following are the steps to create a join index to improve performance:

  1. Connect to the Teradata database using SQLA or Studio.
  2. Check the explain plan for the following query:
/*SELECT on base table*/EXPLAIN SELECT id,dept,emp_Fname,emp_Lname,status from td_cookbook.EMP_SALwhere id=4;1) First, we do a single-AMP RETRIEVE step from td_cookbook.EMP_SAL     by way of the primary index "td_cookbook.EMP_SAL.id = 4" with no     residual conditions into Spool 1 (one-amp), which is built locally     on that AMP. The size of Spool 1 is estimated with low confidence     to be 2 rows (118 bytes). The estimated time for this step is     0.02 seconds.  -> The contents of Spool 1 are sent back to the user as the result of statement 1. The total estimated ...

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.