15.00 - Why You Should Collect Statistics on Base Table Columns Instead of Hash Index Columns - Teradata Database

Teradata Database SQL Data Definition Language Detailed Topics

prodname
Teradata Database
vrm_release
15.00
category
Programming Reference
featnum
B035-1184-015K

Why You Should Collect Statistics on Base Table Columns Instead of Hash Index Columns

The Optimizer substitutes base table statistics for hash index statistics when no demographics have been collected for its hash indexes. Because of the way hash index columns are built, it is generally best not to collect statistics directly on the index columns and instead to collect them on the corresponding columns of the base table. This optimizes both system performance and disk storage by eliminating the need to collect the same data redundantly.

See “Collecting Statistics on a Hash Index” on page 326 for an important contradiction to this recommendation.

You need to collect statistics on the hash index columns if you do not collect the statistics for the relevant base table columns.