Example: Handling Short Queries - Analytics Database - Teradata Vantage

SQL Data Definition Language Syntax and Examples

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Analytics Database
Teradata Vantage
Release Number
17.20
Published
June 2022
Language
English (United States)
Last Update
2024-10-04
dita:mapPath
jco1628111346878.ditamap
dita:ditavalPath
qkf1628213546010.ditaval
dita:id
mdr1472255012272
lifecycle
latest
Product Category
Teradata Vantage™

Log request information with an SQL text limit for user_1 and user_2:

     BEGIN QUERY LOGGING LIMIT THRESHOLD=4 AND SQLTEXT=100 
     ON user_1, user_2;

The following table describes the logging behavior for various request completion times for the specified threshold.

Query Completion Time in Seconds Log Table …
  ≤   4 DBQLSummaryTbl.

The requests are recorded only as counts in the QueryCount column.

  > 4 DBQLogTbl.

The logged SQL text is limited to 100 characters.

Log requests for user_1 and user_2:

     BEGIN QUERY LOGGING WITH SQL, STEPINFO, OBJECTS LIMIT THRESHOLD=10
       CPUTIME ON user_1, user_2;

You can specify equivalent query logging using various methods. For example, specify THRESHOLD with the SQL, STEPINFO, and OBJECTS options individually:

     BEGIN QUERY LOGGING WITH SQL LIMIT THRESHOLD=10 CPUTIME 
       ON user_1, user_2;
     BEGIN QUERY LOGGING WITH STEPINFO LIMIT THRESHOLD=10 CPUTIME 
       ON user_1, user_2;
     BEGIN QUERY LOGGING WITH OBJECTS LIMIT THRESHOLD=10 CPUTIME 
       ON user_1, user_2;