15.00 - About the SEQUENCED Option - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

Product
Teradata Database
Release Number
15.00
Content Type
Programming Reference
Publication ID
B035-1184-015K
Language
English (United States)

About the SEQUENCED Option

The output of the SHOW STATISTICS VALUES option is a spool file 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 file. Teradata 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

Teradata Database inserts the output of the 3 statistics groups into a spool file along with sequence numbers that can be used to maintain the correct order of the output request text. Keep in mind that the Teradata Database row size is approximately 64KB, so the spool file for the output must be chunked into sequences that are no larger than 64KB each. Because of this, Teradata 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. Note that because statistics output 2 is only 30KB, 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;