16.20 - Example - Teradata Vantage NewSQL Engine

Teradata Vantage™ SQL Functions, Expressions, and Predicates

prodname
Teradata Database
Teradata Vantage NewSQL Engine
vrm_release
16.20
category
Programming Reference
featnum
B035-1145-162K

The following example returns the average number of rows per row hash, where columns date_field and time_field constitute the primary index of the table eventlog.

   SELECT COUNT(*) / COUNT(DISTINCT HASHROW (date_field,time_field)) 
   FROM eventlog;

If columns date_field and time_field qualify for a unique index, this example returns the average number of rows with the same hash synonym.