17.10 - Example: Collecting Multicolumn PARTITION Statistics - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.10
Release Date
July 2021
Content Type
Programming Reference
Publication ID
B035-1144-171K
Language
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);

The 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.