SEQUENCED Option | SHOW STATISTICS | Teradata Vantage - About the SEQUENCED Option - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Detailed Topics

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-24
dita:mapPath
jpx1556733107962.ditamap
dita:ditavalPath
lze1555437562152.ditaval
dita:id
B035-1184
lifecycle
previous
Product Category
Teradata Vantage™

The output of the SHOW STATISTICS VALUES option is a spool with a set of output request rows. If the table-level SHOW STATISTICS VALUES, or if you specify multiple column or index sets, the response can contain output from multiple statistics. The SEQUENCED option, which is only valid if you also specify the VALUES option, enables you to report sequence numbers for each such sequence of statistics data in a spool. The database uses the sequence number to identify the boundary of the each statistics output.

For example, assume you are interested in reported detailed statistics for 3 statistics on a table, and the individual detailed statistics have the following sizes.

Statistics Group Size (KB)
1 150
2 30
3 100

The database inserts the output of the 3 statistics groups into a spool along with sequence numbers that can be used to maintain the correct order of the output request text. The spool for the output is chunked into sequences up to 64 KB each. The database inserts up to 64 KB of the output request text into the first sequence, and whatever remains into subsequent sequences.

The final output with sequence numbers for this example is as follows. Because statistics output 2 is only 30 KB, it all fits into a single sequence.

Statistics Output Sequence Number Size (KB)
1 1 64
2 64
3 22
2 1 30
3 1 64
2 36

The following examples demonstrate different uses of the SEQUENCED option.

The following SHOW STATISTICS request displays all the available detailed statistics for table_1 with sequence numbers.

SHOW STATISTICS VALUES SEQUENCED ON table_1;

The following SHOW STATISTICS request displays the detailed statistics on column x1 from table_1 with sequence numbers.

SHOW STATISTICS VALUES SEQUENCED COLUMN x1 ON table_1;

The following SHOW STATISTICS request displays the detailed statistics on columns x1 and y1 from table_1 with sequence numbers.

SHOW STATISTICS VALUES SEQUENCED COLUMN x1, COLUMN y1 ON table_1;

The following SHOW STATISTICS request displays all of the available detailed statistics for table_1 with sequence numbers in XML format.

SHOW IN XML STATISTICS VALUES SEQUENCED ON table_1;