Import External Data | HASH BY RANDOM Option | Teradata Vantage - Disable HASH BY RANDOM - Teradata Vantage - Analytics Database

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-22
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
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 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;