TruncateAnalyzerHistory Stored Procedure | Teradata Vantage - TruncateAnalyzerHistory - Teradata Vantage - Analytics Database

Application Programming Reference

Deployment
VantageCloud
VantageCore
Edition
VMware
Enterprise
IntelliFlex
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
ft:locale
en-US
ft:lastEdition
2025-11-21
dita:mapPath
qld1628112131956.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
ajo1472244909562
lifecycle
latest
Product Category
Teradata Vantageā„¢

Truncates rows from the TDSTATS.AnalyzerHistoryTbl table.

Syntax

REPLACE PROCEDURE TDSTATS.TruncateAnalyzerHistory (
  IN OlderThan      TIMESTAMP(6) WITH TIME ZONE,
  IN DatabaseName   VARCHAR(128) CHARACTER SET UNICODE,
  IN TableName      VARCHAR(128) CHARACTER SET UNICODE,
  IN ObjectListName VARCHAR(128) CHARACTER SET UNICODE,
  IN AnalysisId     BIGINT,
  OUT DeletedRows   INTEGER
)
  ...
;

Syntax Elements

OlderThan
Time. OlderThan deletes all results older than the time you specify.
DatabaseName
Name of the database. DatabaseName deletes rows associated to the database you specify.
TableName
Name of the table within the specified DatabaseName. TableName limits the deletion to rows associated to the table you specify within DatabaseName.
ObjectListName
Name of the object list. ObjectListNamedeletes the rows associated with the object list (that is, one or more database names or fully qualified table names where each name entry may optionally contain wildcard characters) you specify.
For more information about this input parameter, see the usage notes or CreateObjectList.
AnalysisId
Name of the object list. ObjectListNamedeletes the rows associated with the object list (that is, one or more database names or fully qualified table names where each name entry may optionally contain wildcard characters) you specify.
For more information about this input parameter, see the usage notes or CreateObjectList.
DeletedRows
Number of deleted rows.

Usage Notes

Before removing the contents of the TDSTATS.AnalyzerHistoryTb table, Teradata recommends that you review certain information, such as missing statistics recommendations, or it may be lost.

You must periodically run TruncateAnalyzerHistory to prevent the TDSTATS.AnalyzerHistoryTbl table from consuming an excessive amount of space.

Removing Results

If you specify NULL for one of the following input parameters, all rows will be truncated.

To remove results... You must specify a value for ...
from a particular Analyzer-related call or results that are older than the specified time AnalysisId or OlderThan.
on a particular object both DatabaseName and TableName.
for a particular named object list

ObjectListName that was previously created by the CreateObjectList and AddObjectListEntry external stored procedures.

ObjectListName usage is mutually exclusive with DatabaseName and TableName . When you specify a value other than NULL for ObjectListName , DatabaseName and TableName must be NULL.

Example: Using TruncateAnalyzerHistory

The following example shows how to remove all Analyzer-related results that are older than one year.

CALL TDSTATS.TruncateAnalyzerHistory (CAST(CURRENT_DATE - INTERVAL '1' YEAR AS TIMESTAMP(6)),NULL, NULL, NULL, NULL, DeletedRows);

Result:

*** Procedure has been executed.
 *** Total elapsed time was 1 second.
DeletedRows
-----------
       2450