gp_create_table_random_default_distribution

gp_create_table_random_default_distribution

Controls table creation when a Greenplum Database table is created with a CREATE TABLE or CREATE TABLE AS command that does not contain a DISTRIBUTED BY clause.

For CREATE TABLE, if the value of the parameter is off (the default), and the table creation command does not contain a DISTRIBUTED BY clause, Greenplum Database chooses the table distribution key based on the command. If the LIKE or INHERITS clause is specified in table creation command, the created table uses the same distribution key as the source or parent table.

If the value of the parameter is set to on, Greenplum Database follows these rules to create a table when the DISTRIBUTED BY clause is not specified:
  • If PRIMARY KEY or UNIQUE columns are not specified, the distribution of the table is random (DISTRIBUTED RANDOMLY). Table distribution is random even if the table creation command contains the LIKE or INHERITS clause.
  • If PRIMARY KEY or UNIQUE columns are specified, a DISTRIBUTED BY clause must also be specified. If a DISTRIBUTED BY clause is not specified as part of the table creation command, the command fails.
For a CREATE TABLE AS command that does not contain a distribution clause:
  • If the legacy query optimizer creates the table, and the value of the parameter is off, the table distribution policy is determined based on the command.
  • If the legacy query optimizer creates the table, and the value of the parameter is on, the table distribution policy is random.
  • If the Pivotal Query Optimizer creates the table, the table distribution policy is random. The parameter value has no affect.

For information about the legacy query optimizer and the Pivotal Query Optimizer, see "Querying Data" in the Greenplum Database Administrator Guide.

Value Range Default Set Classifications
boolean off master

system

reload