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

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.00
Published
September 2020
Language
English (United States)
Last Update
2021-01-23
dita:mapPath
wgr1555383704548.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

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;