CleanupStatsReport | Application Programming Reference | Teradata Vantage - CleanupStatsReport - 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ā„¢

Displays a summary of events recorded from a prior call to the CleanupStats external stored procedure.

Syntax

REPLACE PROCEDURE TDSTATS.CleanupStatsReport (
  IN AnalysisId BIGINT
)
  ...
;

Syntax Elements

AnalysisId
Result ID from a prior call to the CleanupStats external stored procedure. For more information, see CleanupStats.

Output

Column Description
EventType Event type:
  • C means the event is identified for cleaning.
  • R means the event is identified for reactivation.
EventDescription Text description of the event or action.
EventTimeStamp Time at which the event occurred.
DatabaseName Database on which the cleanup event was recorded.
ObjectName Table on which the cleanup event was recorded.
IndexNumber Index number on which the cleanup event was recorded.
This value is NULL for non-index objects.
FieldNames Column or expression name on which the event was recorded.
Multiple names are separated by a comma.
MarkedInActive If EventType is C, the possible values are:
  • Y means the identified statistic is marked ineligible for future PrepCollect calls.
  • N means the identified statistic is marked eligible for future PrepCollect calls.

If EventType is R, the possible values are:

  • Y means the identified statistic is marked eligible for future PrepCollect calls.
  • N means the identified statistic is marked ineligible for future PrepCollect calls.

For more information, see PrepCollect.

LastAccessedByOpt Last recorded usage by the query optimizer.
StatsId Dictionary assigned ID for the statistic as recorded in the DBC.StatsTbl.StatsId column.
StatsName User assigned name for the statistic, if any.
SCOID Automated Statistics Management assigned ID for the statistic as recorded in the TDSTATS.StatsTbl.SCOID column.
AnalysisId Automated Statistics Management assigned ID for the history results from this CleanupStats operation.

For more information about this external stored procedure, see CleanupStats.

Returning Result Set

The output of this external stored procedure is in the form of a stored procedure dynamic result. That is, the external stored procedure can return result sets to the client application or to the caller of the external stored procedure (in addition to consuming the result sets itself) upon completion of the external stored procedure.

For more information about stored procedure dynamic result sets, see Teradata Vantageā„¢ - SQL External Routine Programming, B035-1147.

Example: Using CleanupStatsReport

The following example shows the summary of events for the Personnel database from a prior invocation of CleanupStats.

CALL TDSTATS.CleanupStatsReport(2);

Result:

 *** Procedure has been executed.
 *** Warning: 3212 The stored procedure returned one or more result sets.
 *** Total elapsed time was 1 second.
 *** ResultSet# 1 : 3 rows returned by "TDSTATS.CLEANUPSTATSUSAGEREPORT".
EventType   EventDescription                DataBaseName   TableName  IndexNumber  FieldNames      
---------   -----------------------------   ------------   ---------  -----------  ----------      
C     STATS IDENTIFIED FOR CLEANING         PERSONNEL      CHARGES    1            EMPNO, PROJ_ID
C     STATS IDENTIFIED FOR CLEANING         PERSONNEL      CHARGES    4            PROJ_ID
R     STATS IDENTIFIED FOR ACTIVATION       PERSONNEL      EMPOYEE    ?            NAME