Example: Logging Plans as XML Text - Advanced SQL Engine - Teradata Database

SQL Data Definition Language Syntax and Examples

Product
Advanced SQL Engine
Teradata Database
Release Number
17.05
Published
January 2021
Language
English (United States)
Last Update
2021-01-22
dita:mapPath
ncd1596241368722.ditamap
dita:ditavalPath
hoy1596145193032.ditaval
dita:id
B035-1144
lifecycle
previous
Product Category
Teradata Vantage™

The XMLPLAN option is particularly useful for diagnosing performance issues with requests. Logging query plans in XML format enables the analysis of problematic requests using Teradata support tools.

This request logs the Optimizer request plans of all requests, including SQL DML and selected DDL statements, performed by user u1 as XML text in DBC.DBQLXMLTbl. Because the XML document contains the full SQL text, specify a LIMIT SQLTEXT value of 0 to avoid duplicate logging of the request text in DBC.DBQLogTbl:

     BEGIN QUERY LOGGING WITH XMLPLAN LIMIT SQLTEXT=0 on u1;