Query Capture Database | VantageCloud Lake - Query Capture Database - Teradata Vantage

Teradata® VantageCloud Lake

Deployment
VantageCloud
Edition
Lake
Product
Teradata Vantage
Published
January 2023
ft:locale
en-US
ft:lastEdition
2024-12-11
dita:mapPath
phg1621910019905.ditamap
dita:ditavalPath
pny1626732985837.ditaval
dita:id
phg1621910019905

A query capture database, or QCD, stores the Optimizer query analysis workload data and the statistical and demographic data needed to support query analysis.

When the Environment is created, a default QCD called TDQCD is created beneath the SystemFE user, but you can also create your own QCD databases, and you can define multiple QCD databases for your systems.

You must be granted the INSERT privilege to use a BEGIN QUERY CAPTURE request to capture query plans in XML format at the session level and write data into TDQCDor any other user-defined QCD.

Vantage determines the size of TDQCD based on the number of system AMPs using the following equation.

TDQCD_size = 50MB + (number_of_system_AMPs x 100 x 1,024 bytes)

You can use the modify_tdqcd.spl SQL stored procedure to modify the size of the TDQCD database based on the number of AMPs in a test system.

Use BTEQ using the CreateQCF table (see Creating the Query Capture Database Tables Procedure Using BTEQ) to create your query capture databases. QCD tables are populated using different methods, including the following:
  • BEGIN QUERY CAPTURE
  • COLLECT DEMOGRAPHICS
  • COLLECT STATISTICS (QCD Form)
  • INSERT EXPLAIN WITH STATISTICS
  • BEGIN QUERY CAPTURE
Because the QCD is often a set of user tables, you can change their individual structure and the structure of the QCD, but never do it.

The reason for this constraint is that the SQL statements BEGIN QUERY CAPTURE, DUMP EXPLAIN, INSERT EXPLAIN, INITIATE INDEX ANALYSIS, RESTART INDEX ANALYSIS, COLLECT DEMOGRAPHICS, and COLLECT STATISTICS (QCD Form) assume the default physical model when capturing the specified query, statistical, and demographic information for insertion into the QCD tables.

INSERT EXPLAIN, DUMP EXPLAIN, and INITIATE INDEX ANALYSIS are supported only on the Block File System on the primary cluster, not on the Object File System.

The results of changing the structure of the QCD tables are unpredictable.