15.10 - Example: Collecting Multicolumn PARTITION Statistics - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

prodname
Teradata Database
vrm_release
15.10
created_date
December 2015
category
Programming Reference
featnum
B035-1144-151K

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.