15.00 - Query 1 - Teradata Database

Teradata Database Design

Teradata Database
User Guide

Query 1

The first query uses the NUPI column phone as the WHERE clause attribute, with the requested value being 555-7777.

     SELECT * 
     FROM Customer 
     WHERE Phone = ‘555-7777’;

1 The hashing algorithm generates the row hash for this primary index access and finds that rows having the NUPI value 555‑7777 hash to AMP 4.

2 The Dispatcher sends an AMP retrieval step directly to AMP 4, where the file system retrieves two matching rows.

The first matching row has row hash=778 and UV=3, while the second matching row has row hash=778 and UV=7. The row hash values are identical because this primary index is non-unique.

3 The file system reads the requested rows and returns them to the requestor.

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

Cust=56, Name=Smith, Phone=555-7777