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

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

Definition

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

Input Parameter

Parameter Description
AnalysisId Results ID from a prior call to the CleanupStats external stored procedure. For more information, 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 .

Output Parameters

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

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);
 *** 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