15.10 - Example: Summary Statistics on a Database - 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

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;