SYSQUERY catalog table
Each SYSIBM.SYSQUERY table row identifies a SQL statement. The information is used to influence access path selection when matching statements are optimized. The schema is SYSIBM.
Column name | Data type | Description | Use |
---|---|---|---|
QUERYID | BIGINT
NOT NULL GENERATED BY DEFAULT AS IDENTITY |
Unique identifier for the query. | G |
QUERY_HASH | CHAR(16)
NOT NULL FOR BIT DATA |
The hash key generated by statement text. | G |
SCHEMA | VARCHAR(128)
NOT NULL |
The default schema name for unqualified
objects in the query or blank. If the query contains unqualified objects and access path hints exist for the query, the access path hints are applied only if the default schema matches the schema in the access path hint. |
G |
QUERY_SEC_HASH | CHAR(16)
NOT NULL FOR BIT DATA |
The hash key generated by the modified statement text. | G |
QUERY_HASH_
VERSION |
INTEGER
NOT NULL |
The version of the query hash. | G |
SOURCE | SMALLINT
NOT NULL |
The source of the row:
|
G |
USERFILTER | CHAR(8)
NOT NULL |
Filter name that is used to group a set of queries or blank. | G |
— | CHAR(128)
NOT NULL |
Internal use only. | I |
PLAN_VALID | CHAR(1)
NOT NULL |
Whether plan hints are valid:
|
G |
INVALID_REASON | INTEGER
NOT NULL |
When PLAN_VALID is N, this column contains the reason that the access path is invalid. If PLAN_VALID is Y or blank, this column contains -1. For descriptions of the reason code values, see: +395. | S |
LOCATION | VARCHAR(128)
NOT NULL |
Not used. | N |
COLLECTION | VARCHAR(128)
NOT NULL |
Name of the collection of the originating query or blank. | G |
PACKAGE | VARCHAR(128)
NOT NULL |
Name of the package of the originating query or blank. | G |
VERSION | VARCHAR(128)
NOT NULL |
Version of the package or blank. | G |
AUTHID | VARCHAR(128)
NOT NULL |
Authorization ID this was in effect when the query was captured or blank. | G |
BINDTIME | TIMESTAMP
NOT NULL |
Timestamp when the package was bound or when BIND QUERY was run | G |
RELBOUND | CHAR(1) NOT NULL
|
The release of Db2 in which the package was bound, or blank. See Release dependency indicators for values. | G |
IBMREQD | CHAR(1)
NOT NULL |
A value of Y indicates that the row was provided with the Db2 product code. For all other values, see Release dependency indicators. The value in this field is not a reliable indicator of release dependencies. RELBOUND should be used instead. |
G |
STMTNO | INTEGER
NOT NULL |
The statement number in the package. -1 when not applicable. | G |
SECTNO | INTEGER
NOT NULL |
The section number in the package. -1 when not applicable. | G |
STMTTEXT | CLOB(2M)
INLINE LENGTH 2048 |
The
text of the matching SQL statement. The value is populated from the
value of the QUERY_TEXT column of the DSN_USERQUERY_TABLE table, with
the following items removed:
|
G |
QUERYNO | INTEGER
NOT NULL WITH DEFAULT '-1' |
The query number. | G |
CLIENT_USERID | VARCHAR(255)
|
User ID of the client. | G |
CLIENT_
WRKSTNNAME |
VARCHAR(255)
|
Name of the client workstation. | G |
CLIENT_APPLNAME | VARCHAR(255)
|
Name of the client application. | G |
SELECTVTY_
OVERRIDE |
CHAR(1) NOT NULL | Whether
selectivity overrides are in effect for the query:
|
G |
ACCESSPATH_
HINT |
CHAR(1) NOT NULL | Whether
access paths are specified for the matching statements:
|
G |
OPTION_OVERRIDE
|
CHAR(1) NOT NULL | Whether
statement-level optimization parameters are in effect for matching
statements:
|
G |
SELECTIVITY_VALID
|
CHAR(1) NOT NULL | Whether
selectivity overrides are valid:
|
G |
![]() ![]() |
![]() ![]() |
![]() ![]() |
![]() ![]() |