Example: Short Requests Based on CPU Time - 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™

As an alternative to using SUMMARY or THRESHOLD options for short duration requests, specify the CPUTIME option. You can save the count only or fully log request information based on the number of CPU seconds required to complete a request.

This request counts the number of requests for user_1 during a session in each of the CPU second intervals specified:

     BEGIN QUERY LOGGING LIMIT SUMMARY=100, 200, 300 CPUTIME ON user_1;

CPUTIME intervals are created in units of 0.01 seconds of CPU time. This query specifies these intervals:

  • 0 - 1 CPU seconds
  • 1 - 2 CPU seconds
  • 2 - 3 CPU seconds
  • >3 CPU seconds

This request creates a rule to increment the query counter in DBQLSummaryTBL for requests in a session for user_1 taking less than 100 CPU seconds and to log a complete DBQL entry in DBQLogTbl for requests over 100 CPU seconds:

     BEGIN QUERY LOGGING LIMIT THRESHOLD=100 CPUTIME ON user_1;