15.00 - Query 2 - Teradata Database

Teradata Database Design

Teradata Database
User Guide

Query 2

The second query uses the USI column Cust as the WHERE clause attribute, with the requested value being 95.

     SELECT * 
     FROM Customer 
     WHERE Cust = 95;

1 The hashing algorithm generates the row hash for this USI access.

The hash map indicates that an index row having the value 95 hashes to the customer USI subtable on AMP 3 with a row hash=588.

2 The Dispatcher sends an AMP retrieval step directly to AMP 3, where the file system reads the subtable row having the row hash=588 to determine which AMP owns the base table row.

3 The file system retrieves the base table row hash 778 and uniqueness value 3 from the USI subtable row and determines that the requested base table row is stored on AMP 4.

4 The retrieval directive is passed to AMP 4 where the row for customer number 95, having rowID value 778,3 is located.

5 The file system reads the requested row and returns it to the requestor.

Cust=95, Name=Peters, Phone=555‑7777