How it works...

In earlier version of database, before Teradata 14, the max value for maxvaluelength was 16 bytes/ character; from Teradata 14, the default is 25 bytes to max histogram size (64 K). Below table compares two options.

Syntax element
Reason

MAXVALUELENGTH n

The maximum value length for histogram values such as MinValue, ModeValue, MaxValue, BiasedValue, and so on.

For single-column statistics with CHAR or VARCHAR type columns, the size is taken as the number of characters. For single-column statistics with non-character type columns and multi-column statistics, the size is taken as the number of bytes.

For multi-column statistics, the values are concatenated and truncated to the specified maximum size.

The valid range ...

Get Teradata Cookbook now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.