Import External Data | HASH BY RANDOM Option | Teradata Vantage - 17.00 - Disable HASH BY RANDOM - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Release Date
September 2020
Content Type
Programming Reference
Publication ID
B035-1144-170K
Language
English (United States)

You can use CREATE TABLE...AS with a SELECT subquery to copy data from a foreign table into a permanent table without a primary index. See Example: Copying Data from a Foreign Table into a Permanent Table.

Internally, the SELECT subquery performs an INSERT...SELECT operation with the HASH BY RANDOM clause to provide even distribution of data. The HASH BY RANDOM clause is the default for an INSERT...SELECT operation from a foreign table into a permanent table without a primary index. You can disable this behavior.

This statement disables the random distribution of rows for the session.

SET QUERY_BAND = 'DisableHashByRandom = ON' FOR SESSION;

This statement disables the random distribution of rows for the transaction.

SET QUERY_BAND = 'DisableHashByRandom = ON' FOR TRANSACTION;