15.10 - Example: Summary Statistics on a Database - Teradata Database

Teradata Database SQL Data Definition Language Syntax and Examples

Product
Teradata Database
Release Number
15.10
Published
December 2015
Content Type
Programming Reference
Publication ID
B035-1144-151K
Language
English (United States)
Last Update
2018-06-05

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;