Prepare and Collect Statistics | Application Programming Reference | Vantage - Preparing and Collecting Statistics - Advanced SQL Engine - Teradata Database

Application Programming Reference

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
17.00
Published
June 2020
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
cpn1571792172880.ditamap
dita:ditavalPath
lze1555437562152.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.