Statistics are to be collected for a column set.
- expression
- An expression or a list of expressions for which statistics are to be collected. The result of the expression must be a data type on which field statistics can be collected directly, such as an integer, character, or date. Expressions can reference scalar UDFs, UDTs, and the BEGIN or END expressions of a Period type column. For more information on the SQL expressions you can use, see Teradata Vantage™ - SQL Functions, Expressions, and Predicates, B035-1145.
You cannot specify nondeterministic expressions such as RANDOM, nondeterministic UDFs, and nondeterministic CAST or EXTRACT operations.
- column_name
- The names of the columns for which statistics are to be collected.
- The maximum number of columns on which joint statistics can be collected for a single COLLECT STATISTICS request is 64.
- You cannot collect statistics on columns with a data type of Period, JSON, XML, BLOB, CLOB, or any UDT other than Geospatial.
- You can collect statistics on the BEGIN and END expressions for a Period type column.
A geospatial NUSI column cannot be specified with other columns.
- Statistics can be collected on extracted portions of the JSON type. See Teradata Vantage™ - JSON Data Type, B035-1150.
- PARTITION
- Statistics are to be collected on the system-derived PARTITION column set for a table.
- You should collect PARTITION statistics on tables that are partitioned by row or column because the Optimizer uses them to do the costing and cardinality estimation based on the partition elimination. For all partitioned tables, any refreshment operation should include the system-derived PARTITION column set.
- You cannot use this option to collect statistics on a geospatial NUSI.
- You cannot collect statistics on the system-derived PARTITION#Ln columns.
- statistics_name
- The statistics collected are to be saved under statistics_name.
- A statistics_name is required if statistics are for other than column references. When recollecting statistics, if the column ordering is different or if the expressions do not find an exact match with existing statistics, the Optimizer collects the statistics as new. Naming the statistics and using the names during recollections ensures that the existing statistics are recollected instead of creating a new set of statistics.
- You cannot specify this option for COLUMN PARTITION or COLUMN (PARTITION).
- You can use the statistics name for recollections, copies, transfers, HELP STATISTICS, SHOW STATISTICS, and DROP STATISTICS.