When to Use DROP and COLLECT STATISTICS - Analytics Database - Teradata Vantage

SQL Data Definition Language Detailed Topics

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2023-07-11
dita:mapPath
vuk1628111288877.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
B035-1184
lifecycle
latest
Product Category
Teradata Vantage™

If you suspect that your table statistics are not current, you should recollect them. The statistics recollection logic retains the history of the information from the prior histograms, which is used to extrapolate stale statistics to freshen them.

The formerly recommended practice of dropping stale statistics is now deprecated because when you drop statistics, you also drop the appropriate history records.

If the column demographics are drastically changed and the history records are no longer able to determine the column trend for the new data, drop the statistics to eliminate the history records and recollect them.

Executing a COLLECT STATISTICS request writes new table demographics over the existing values, so you really do not need to drop old values prior to collecting new ones if you plan to recollect statistics for an entire table.