15.10 - Automating Statistics Collection and Monitoring - Teradata Database

Teradata Database Application Programming Reference

prodname
Teradata Database
vrm_release
15.10
category
Programming Reference
featnum
B035-1090-151K

You can manage statistics collection manually using Automated Statistics Management open APIs or automatically using the Teradata Viewpoint Stats Manager portlet. For more information about this portlet, see the Teradata Viewpoint documentation.

To identify any already existing statistics that you want to incorporate into automated procedure:

Call an Automate-related open API.

This API copies the qualifying statistics definitions from the DBC dictionary to the TDSTATS database.

Note: The TDSTATS database only stores metadata required to conduct Automated Statistic Management specific tasks on the statistics. You can use Teradata Studio or Teradata Studio Express to view details about the TDSTATS database, including tables, table columns, and views.

For a given database or table, the initial Automate operation is performed once.

If you subsequently collect additional statistics on these same tables or create new tables within a previously automated database, any resulting new dictionary stored statistics can be copied by calling the Automate operation again.

Note: Teradata recommends that you periodically call the Automate operation on the same objects to ensure all statistics on those objects are automated. You can repeat the same Automate-related call as many times as needed.

After a given set of statistics are automated, call the following open APIs:
a
PrepCollect to generate a prioritized list of collections based on the automated statistics definitions stored in the TDSTATS database. For more information, see “Preparing and Collecting Statistics” on page 472 or “PrepCollect” on page 546.
b
RunCollect or ReCollectTable to perform a recollection on the set of statistics. For more information, see “Preparing and Collecting Statistics” on page 472.
c
DeAutomateStats to reverse the operation or the SelectAutomatedStats open API to list the statistics that are currently automated. For more information, see “DeAutomateStats” on page 497 or “SelectAutomatedStats” on page 504.