Collecting Stats

General
Teradata Employee

Re: Collecting Stats

Stats on this column are strongly indicated if the column is used in the where clause regularly. If you do not have stats, the optimizer will assume approximately 5% selectivity which will be far off from the 50% (assuming the values have even representation).

A NUSI on this very non-unique column will not be used. A NUSI needs to have values that are represented in fewer rows than there are data blocks in the table.

Sample stats are not optimal for extremely non-unique columns like this. It is hard to get an accurate sample that correctly represents the distribution. But this is the cheapest type of data to collect full stats on. Plus it is very likely that these stats only need to be collected very infrequently since the distribution is unlikely to change quickly.

Compression for this column is strongly indicated.