HELP STATISTICS Examples | Teradata Vantage - 17.00 - Example: Summary Statistics on a Database - Advanced SQL Engine - Teradata Database

Teradata Vantage™ - SQL Data Definition Language Syntax and Examples

Advanced SQL Engine
Teradata Database
Release Number
September 2020
Content Type
Programming Reference
Publication ID
English (United States)

If statistics have been collected for the employee table in the personnel database, you can use the following request to obtain a list of the columns of the employee table that currently have statistics.

     HELP STATISTICS personnel.employee;

The result shows that statistics were last collected for YrsExp on 02/06/03, when there were 17 unique values for the column.

     Date      Time     Unique Values        Column Names 
     --------  -------- -------------------- ---------------- 
     02/06/03  13:12:45                   17 YrsExp

Suppose you have collected statistics on the following single and multicolumn sets from the orders table.

     COLLECT STATISTICS COLUMN (o_orderdate), 
                        COLUMN (o_orderkey), 
                        COLUMN (o_orderdate, o_orderkey), 
                        COLUMN (o_orderkey, o_orderdate) 
     ON orders;

The following request displays a summary of statistical information for the orders table.

     HELP STATISTICS orders;