Preparing and Collecting Statistics - Teradata Database - Teradata Vantage NewSQL Engine

Application Programming Reference

Product
Teradata Database
Teradata Vantage NewSQL Engine
Release Number
16.20
Published
March 2019
Language
English (United States)
Last Update
2019-05-02
dita:mapPath
vwf1492987142269.ditamap
dita:ditavalPath
changebar_rev_16_20_exclude_audience_ie.ditaval
dita:id
B035-1090
lifecycle
previous
Product Category
Teradata Vantageā„¢

You can use the set of Collect-related APIs to prepare and submit COLLECT STATISTICS commands on the automated statistic definitions stored in the TDSTATS database.

The collection process is divided into two phases:
  • The prepare phase allows you to view and modify a prepared collection list prior to its actual submission. Each list of collection commands generated by a call to the PrepCollect open API is assigned a unique ID which is passed to the RunCollect open API to execute the list.
  • The run phase allows you to specify a time limit. When the specified time expires, RunCollect will stop issuing any additional collections. If the specified time expires, you can resume the prior execution at a later time.

Although Teradata recommends that you call the PrepCollect open API before every call to RunCollect to incorporate the latest stale or missing statistics information, you can reuse the same list of collection commands in consecutive calls to RunCollect.

For more information, see PrepCollect or RunCollect.

Functionality

If you want to ... Use the following SQL interface ...
prepare a prioritized list of COLLECT STATISTICS commands suitable for an execution or Run operation. PrepCollect.
execute the list of COLLECT STATISTICS commands generated by the PrepCollect open API RunCollect.
prepare and immediately execute collections on the automated statistics for a specified table ReCollectTable.
report a summarized list of pending, in-progress, and completed collections for an execution run RunCollectReport.
display the list of collection commands generated by the PrepCollect open API SelectPreparedCollects.
display a list of completed collections for one or more past execution runs SelectStatsExecutionHistory.
abort pending or in-progress collections from an in-progress RunCollect AbortCollect.