Distribution keys
Each table in a database has only one distribution key. The key can consist of one to four columns of the table.
- To create an explicit distribution key, the Netezza Performance Server SQL
syntax is:
CREATE TABLE <tablename> [ ( <column> [, … ] ) ] DISTRIBUTE ON [HASH] ( <column> [ ,… ] ) ;The phrase DISTRIBUTE ON specifies the distribution key, the word HASH is optional.
- To create a table without specifying a distribution key, the Netezza Performance Server SQL
syntax is:
CREATE TABLE <tablename> (col1 int, col2 int, col3 int);The Netezza Performance Server system selects a distribution key. There is no way to guarantee what that key is and it can vary depending on the Netezza Performance Server software release.
- To create a random distribution, the Netezza Performance Server SQL
syntax is:
CREATE TABLE <tablename> [ ( <column> [, … ] ) ]DISTRIBUTE ON RANDOM;
For more information about the CREATE TABLE command, see the IBM® Netezza® Database User’s Guide.