SelectAutomatedStats Syntax - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

API Definition

REPLACE PROCEDURE TDStats.SelectAutomatedStatsJSON(
  IN jIn JSON(2000) CHARACTER SET UNICODE)
  DYNAMIC RESULT SETS 1

JSON Input Keys

JSON Key Data Type Description
DatabaseName VARCHAR(128) Limit output to stats belonging to a specified database.
TableName VARCHAR(128) Further limit output to a specified table within DatabaseName.
ObjectListName VARCHAR(128) Limit output to stats belonging to objects within a specified list name.

Dynamic SQL Result Columns

Column Name Data Type Description
DatabaseName VARCHAR(128) Database in which the statistic is defined.
TableName VARCHAR(128) Table on which the statistic is defined.
ExpressionList VARCHAR(10000) Comma separated list of field names on which the statistic is defined.
IndexId INTEGER Dictionary identifier of index on which statistic is defined or NULL no index exists.
SCOID BIGINT AutoStats assigned identifier of the statistic.
ApprovedStat CHAR(1) Flag indicating whether the recommended statistic has been approved for application ('Y' or 'N').
StatsState CHAR(1)
  • 'M' - Missing statistic recommendation that is not yet applied
  • 'S' - Potentially stale
  • 'C' - Current and up to date
StatsOrigin CHAR(1)
  • 'U' - User defined
  • 'A' - Automatically recommended by the system
LastCollectTimeStamp TIMESTAMP(6) Time of when the statistic was last collected.
LastEvaluationTimeStamp TIMESTAMP(6) Time when the statistics was last submitted for collection.

Depending on the THRESHOLD evaluation, the statistic may or may not have been recollected.

ThresholdSkipCnt INTEGER Number of consecutive submissions where the statistic did not meet its defined threshold for recollection.
LastAccessedByOpt TIMESTAMP(6) Last recorded statistics usage by the Query Optimizer according to USECOUNT activity counters.
QryUsageFrequency INTEGER Number of logged queries observed using the statistic.
MissingFrequency INTEGER Number of queries observed wanting the missing statistic.
EstErrorFrequency INTEGER Number of queries wanting the missing statistic and observed with cardinality estimation inaccuracies.
CreateUser VARCHAR(128) User who originally automated the statistic.
CreateTimeStamp TIMESTAMP(6) Time in which the statistic was originally automated.