Distributing Columns for GreenPlum

From ER/Studio Data Architect
Jump to: navigation, search

Go Up to Developing the Physical Model

The Distribution tab of the Table Editor for the GreenPlum platform allows you to create the DISTRIBUTED BY or DISTRIBUTED RANDOMLY statements that specify the distribution key. If you do not specify the columns of the distribution key and do not activate the random distribution option, the GreenPlum server will assign to the distribution key by default by the first column created in the table.

  • Available Columns: Displays all the columns available to add to the distribution key. Select the column you want to add to the distribution key and move it to the Selected Columns box. Use the left and right arrows to move columns to and from the Selected Columns box. When no unique indexes or primary key columns are specified, this list includes all the columns of the table.
  • Selected Columns: Displays the columns that make up the distribution key.
  • Up / Down buttons: Let you reorder the columns in the distribution key. The column order can affect the access speed. The most frequently accessed columns should be at the top of the Selected Columns list. The Up/Down buttons are disabled when a single unique or primary index exists. In that case, the columns in the distribution key will be ordered automatically to must match the order of the index columns.
  • Random: This option is available on if there are no unique indexes or primary keys specified for the table. If selected, the table is created using a random round-robin distribution key.

Completing this tab with the Random option selected will produce SQL code similar to the following:

CREATE TABLE "Entity1"(

"PK1" CHAR(10) NOT NULL,

"A1" CHAR(10),

"A2" CHAR(10),

)

DISTRIBUTED RANDOMLY

Selecting PK1 to be the only column in the distribution key will produce SQL code similar to the following:

CREATE TABLE "Entity1"(

"PK1" CHAR(10) NOT NULL,

"A1" CHAR(10),

"A2" CHAR(10),

CONSTRAINT "PK1" PRIMARY KEY ("PK1")

)

DISTRIBUTED BY ("PK1")


See Also