15.10 - Example: Collecting Multicolumn PARTITION Statistics - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

Teradata Database
Release Number
December 2015
Content Type
Programming Reference
Publication ID
English (United States)

This example collects multicolumn statistics on the following column set for the orders table.

  • System-derived PARTITION column
  • quant_ord
  • quant_shpd
         COLLECT STATISTICS ON orders 
         COLUMN (quant_ord, PARTITION, quant_shpd);

Teradata Database honors the column ordering that you specify. The recommended best practice is to specify the PARTITION as the first column for multicolumn PARTITION statistics. Collecting single-column PARTITION statistics is recommended for partitioned and nonpartitioned tables. However, multicolumn PARTITION statistics are only potentially useful for row partitioned tables.