79779938

Date: 2025-10-01 10:53:09
Score: 1
Natty:
Report link

This could be due to stats truncation. Default MaxValueLength for a given column stat is 26 Bytes on TD17.20 for example.

If the total Byte size being reserved by your column spec is greater than 26 Bytes, then you need to explicitly add the "MaxValueLength 30" (or more than 30, depending on total Byte size of the column or combined columns in the column stat).

Byte Size is reportyed in dbc.ColumnsV. Just be aware that the "VAR" data types have a 2-Byte extra overhead for carrying the data length information. So Varchar(2) would reserve 4 Bytes.

For example:

Collect stats using no sample and no threshold and maxValueLength 30

column (My_8Byte_Column, My_12Byte_Column ,My_10Byte_Column) -- Adds up to 30 Bytes

on MyTable_01;

Collect stats using no sample and no threshold and maxValueLength 32

column (My_14Byte_Column, My_18Byte_Column) -- Adds up to 32 Bytes

on MyTable_01;

Collect stats using no sample and no threshold --(no need for MaxValueLength up to 26 Bytes)

column (My_16Byte_Column, My_10Byte_Column) -- Adds up to 26 Bytes

on MyTable_01;

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Unregistered user (0.5):
  • Low reputation (1):
Posted by: Etienne Stieger