15.10 - AddQueryList - Teradata Database

Teradata Database Application Programming Reference

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

Creates a new query list with a user specified name which can be passed to AnalyzeStatsUsage for analysis.

REPLACE PROCEDURE TDSTATS.AddQueryList(
  IN QueryListName VARCHAR(128) CHARACTER SET UNICODE)
           .
           .
           .
;
 

Parameter

Description

QueryListName

Name of the query list.

Note: QueryListName must be unique among all query lists stored in the TDSTATS database.

After a new query list is created, you can call the AddQueryListEntry external stored procedure to add queries to a list.

The following example shows how to create a list consisting of two queries and analyze statistics usage on them.

Note: The input argument value that begins with a colon represents a host variable whose value was populated in a prior call where it served as an output argument.

CALL TDSTATS.AddQueryList('MySlowQueries');
CALL TDSTATS.AddQueryListEntry('MySlowQueries',8675309,1);
CALL TDSTATS.AddQueryListEntry('MySlowQueries',8675325,1); 
CALL TDSTATS.AnalyzeStatsUsage(NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'MySlowQueries',
'N',AnalysisId, NumEvents);
CALL TDSTATS.AnalyzeStatsUsageReport(:AnalysisId);
 

For more information on ...

See ..

the AnalyzeStatsUsage external stored procedure

“AnalyzeStatsUsage” on page 518.

adding queries to your list

“AddQueryListEntry” on page 611.