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. |