Import External Data | HASH BY RANDOM Option | Teradata Vantage - 17.10 - 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.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1144-171K
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 Foreign Table into 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;