1

Teradata Statistics MaxValueLength

 

In some rare cases, you may be forced to collect statistics on large character columns.

Probably you never recognized it, but, until release 13.10, Teradata was restricting the number of bytes considered for building the statistics histograms to 16.

This restricting means, all characters past the 16th bytes have been cut-off.

The column value “012345678901234567890” actually was considered as “0123456789012345”.

Cutting off after 16 bytes lead to wrong estimations which are tough to detect.

Teradata Statistics MaxValueLength is an enhancement to Teradata statistics, which improves the situation.

With Release 14, Teradata increased the number of considered bytes to 25 by default. If the 25 bytes are not enough, you can override this default value with below syntax:

COLLECT STATISTICS USINGMAXVALUELENGTH 100 COLUMN (<COLUMN>) ON <TABLE> ;

In above example, 100 bytes would be used to build the histogram on column <COLUMN>

 

Roland Wenzlofsky
 

Roland Wenzlofsky is a graduated computer scientist and Data Warehouse professional working with the Teradata database system for more than 15 years. He is experienced in the fields of banking and telecommunication with a strong focus on performance optimization.

  • Avatar harish says:

    Can you show some examples in T13.10?

    So if I have a T1(col1 char(16),col2 char(20)), will the stats on (col1,col2) ignore col2? What does help stats show.

  • >