Setting the default table organization

You can set the default table organization for user-defined tables to row or column. The default table organization is used when you create tables without specifying the ORGANIZE BY COLUMN or the ORGANIZE BY ROW clause for the CREATE TABLE statement. The default table organization setting is row.

Before you begin

Before you set the default table organization to COLUMN, ensure that you meet the prerequisites for creating column-organized tables. For details, see Creating column-organized tables.

Procedure

To set the default table organization, set the dft_table_org database configuration parameter in one of the following ways:

  • Issue the UPDATE DATABASE CONFIGURATION command:
    • To create column-organized tables by default, specify the COLUMN value.
    • To create row-organized tables by default, specify the ROW value.
  • Set the DB2_WORKLOAD registry variable to ANALYTICS. This setting establishes a configuration that is optimal for analytic workloads, which includes setting the dft_table_org database configuration parameter to COLUMN to create column-organized tables by default.

Example

The following sample command shows you how to set COLUMN as the default table organization for the SAMPLE database:
update db cfg for sample using dft_table_org column