Teradata Query Capture Database - Teradata Studio

Teradata Studio IDE Plug-in User Guide

Product
Teradata Studio
Release Number
15.12
Published
August 2016
Language
English (United States)
Last Update
2018-05-03
dita:mapPath
pts1468860020550.ditamap
dita:ditavalPath
ft:empty
dita:id
B035-2043
lifecycle
previous
Product Category
Teradata Tools and Utilities

The QCF requires a Query Capture Database (QCD) that contains specific table definitions. An INSERT EXPLAIN INTO your_qcd_name AS name_of_SQL_File SQL_Statement command is executed to create and insert the step information into the QCD. The SQL File name for your SQL statement is also stored in the QCD using the AS name_of_SQL_File clause.

You must create the QCD database before attempting the Get Execution Plan or Get Execution Plan with Statistics option from within the SQL Tools selection menu. You create the QCD database by clicking Create QCD Database to open the Create Database dialog. You can also refer to a QCD that was created using the Teradata Visual Explain product Control Center or to an existing database as your designated QCD database.

If you are using the Teradata Visual Explain product to create your QCD database, the QCD tables are created automatically. If you used the Create Database dialog or manually created your QCD database using an SQL command, you must create the QCD tables. To create the tables, click Create QCD Tables.

You must have SELECT, EXECUTE, and INSERT privilege on the QCD. If the QCD and its tables are created by the preference screen, CREATE and REPLACE privileges are also required.
Element Description
Connected Profile Name List of currently connected profiles. Select the name of the connected profile to use when getting the execution plan.
QCD Database Name List of databases for the connected profile you selected. Select the QCD database name to use when getting the execution plan.
Create QCD To enable this button, select a connected profile. It opens the Create Database dialog.
Create QCD Tables To enable this button, select a database from the database selection list. It is used to create the QCD tables in the QCD database. A confirmation message indicates the tables were created successfully.
Save Association To enable this button, select a profile and database. It is used to save the profile/QCD database names in the association table.
Profile/QCD Association Table
Contains the list of profile/QCD database name associations. The associations are stored in the user workspace and used by the Teradata Execution Plan Service when one of the following requests is made:
  • Get Execution Plan or
  • Get Execution Plan with Statistics - provides the capability to run the INSERT EXPLAIN command WITH STATISTICS. This indicates that statistics for the WHERE clause condition columns specified in the SQL_Statement are to be captured. This is equivalent to performing COLLECT STATISTICS (QCD Form) on the query table columns. The columns inserted into the QCD are those determined to be index candidates by the Teradata Index Wizard.
    You must create the QCD database before attempting the Get Execution Plan or Get Execution Plan with Statistics option from within the SQL Tools selection menu. You create the QCD database by clicking Create QCD Database to open the Create Database dialog. You can refer to a QCD that was created using the Teradata Visual Explain product Control Center or to an existing database as your designated QCD database.
Remove Association To enable this button, profile/QCD database name associations must exist in the Association Table. Select the profile name and click Remove Association to remove a profile/QCD database name association from the table.
Statistics Sample Percentage %

Percentage of data to be read for collecting statistics when the user chooses the Get Execution Plan with Statistics SQL Tools menu option. Valid percentage values are between 0 and 100. A value of 0 indicates that the option is not used. Otherwise, the USING SAMPLE clause is added to the INSERT EXPLAIN WITH STATISTICS command to create the execution plan in the QCD.