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

Adds a query to a specified query list where the query is identified by its DBQL ID.

Syntax

REPLACE PROCEDURE TDSTATS.AddQueryListEntry (
  IN QueryListName VARCHAR(128) CHARACTER SET UNICODE,
  IN QueryId DECIMAL(18,0)),
  IN Frequency INTEGER
)
  ...
;

Syntax Elements

QueryListName
Name of already created query list. For more information, see AddQueryList.
QueryId
DBQL assigned ID for the query as stored in DBC.DBQLogTbl.QueryID.
Frequency
Number of logged instances of this same query.
If you specify NULL, the assumed frequency is 1.

Usage Notes

Typically, queries in need of performance tuning are added to a query list.

You can view the query list data in the TDSTATS.QueryList and TDSTATS.QueryListEntry tables and the names of the query lists in the TDSTATS.QueryList.ListName column.

Example: Using AddQueryListEntry

The following example shows how to add queries 8675309 and 8675325 to the query list named MySlowQueries.

The input parameter value that begins with a colon represents a host variables whose value was populated in a prior call where it served as an output parameter.
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);

Related Information

For more information on .... See ...
previous created query lists AddQueryList.
the DBC.DBQLogTbl.QueryID column Teradata Vantageā„¢ - Database Administration, B035-1093 or use Teradata Studio or Teradata Studio Express to view details about this column.