Using RANDOM as a Condition on an Index

Teradata Vantageā„¢ SQL Functions, Expressions, and Predicates

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

Because the RANDOM function is evaluated for each selected row, a condition on an index column that includes the RANDOM function results in an all-AMP operation.

For example, consider the following table definition:

   CREATE TABLE t1
      (c1 INTEGER
      ,c2 VARCHAR(9))
   PRIMARY INDEX ( c1 );

The following SELECT statement results in an all-AMP operation:

   SELECT * 
   FROM t1 
   WHERE c1 = RANDOM(1,12);