Function of Query
Describes information about captured queries.
Query Table Definition
The following CREATE TABLE request defines the Query table:
CREATE TABLE Query( QueryID INTEGER NOT NULL, UDB_Key INTEGER NOT NULL, MachName VARCHAR(30) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL, NumAMPs INTEGER NOT NULL, NumPEs INTEGER NOT NULL, NumNodes INTEGER NOT NULL, ReleaseInfo VARCHAR(256) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL, VersionInfo VARCHAR(256) CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL, PENum INTEGER NOT NULL, QueryText VARCHAR(20000) CHARACTER SET UNICODE NOT CASESPECIFIC, CaptureTimeStamp TIMESTAMP(0) NOT NULL, QueryName VARCHAR128 CHARACTER SET UNICODE NOT CASESPECIFIC, Frequency INTEGER NOT NULL, StatementTypes VARCHAR(120) CHARACTER SET LATIN NOT CASESPECIFIC NOT NULL, DefaultDBName VARCHAR128 CHARACTER SET UNICODE NOT CASESPECIFIC NOT NULL, Overflow CHARACTER(1) CHARACTER SET LATIN, NOT CASESPECIFIC, Complete CHARACTER(1) CHARACTER SET LATIN, NOT CASESPECIFIC, ValidatedPlan CHARACTER(1) CHARACTER SET LATIN, NOT CASESPECIFIC, ImportedPlan CHARACTER(1) CHARACTER SET LATIN, NOT CASESPECIFIC, SessionTemporalQualifier VARCHAR(1024) CHARACTER SET LATIN NOT CASESPECIFIC, TemporalTimestamp TIMESTAMP(0), TotalCost FLOAT DEFAULT 0), UNIQUE PRIMARY INDEX PK_QueryID (QueryID);
Attribute Definitions for Query
The following table defines the Query table attributes:
|UDB_Key||Identifier for the user who captured the plan by submitting either a DUMP EXPLAIN, INSERT EXPLAIN, or BEGIN QUERY CAPTURE statement (see SQL Data Definition Language for descriptions of these statements).|
|MachName||Name of the test machine on which the query plan is captured.|
|NumAMPs||Number of AMPs in the configuration.|
|NumPEs||Number of PEs in the configuration.|
|NumNodes||Number of nodes in the configuration.|
|ReleaseInfo||Teradata Database release number under which the query was captured.
The value is defined in DBC.DBCInfo.
|VersionInfo||Teradata Database version number under which the query was captured.
The value is defined in DBC.DBCInfo.
|PENum||Number of the parsing engine on which the query was processed.|
|QueryText||The SQL DML text of the captured query.
If the text exceeds the upper limit of 20,000 characters, then it overflows to the QryRelX table. See QryRelX.
|CaptureTimeStamp||Timestamp that identifies when the captured query was performed.
Useful for distinguishing among multiple performances of the same query on the same machine under the same software version and release.
|QueryName||The name of the query, if provided, as specified in the AS clause.|
|Frequency||The number of times the query is performed in the workload to which it is assigned.
The value is specified by the INSERT EXPLAIN statement that is used to create the row.
|StatementTypes||A comma-separated list of 3-character statement type codes.
|DefaultDBName||The name of the default database at the time the query plan is captured.|
|Overflow||Specifies whether QueryText exceeds 20 000 characters.
If QueryText exceeds 20,000 characters, then all text beyond that boundary is truncated.
|Complete||Identifies whether Query stores the complete query text or a truncated version.
|ValidatedPlan||Specifies whether the plan was captured in validation or non-validation mode.
The value is always set to F during the capture.
|ImportedPlan||Specifies whether the query plan was captured on the current system or imported from another system.
The system always sets the flag to F during the capture.
|TemporalTimestamp||The timestamp value derived from evaluating the TEMPORAL_TIMESTAMP function at the time the query was captured.
This column is only populated for requests that either reference temporal tables or that invoke the functions TEMPORAL_TIMESTAMP or TEMPORAL_DATE.
The column is set null if the captured query does not reference temporal tables or invoke the TEMPORAL_TIMESTAMP or TEMPORAL_DATE functions.
See Temporal Table Support for details about temporal timestamping.
|SessionTemporalQualifier||Specifies the temporal qualifier for the session specified by the most recent SET SESSION temporal_qualifier request.
The valid session temporal qualifiers are indicated in the following list:
|TotalCost||The estimated total cost of performing this query, expressed in milliseconds.|