Start of change

SYSIBM.SYSQUERY table

Each SYSIBM.SYSQUERY table row identifies a SQL statement. The information is used to influence access path selection when matching statements are optimized.

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.

Start of changeIf 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.End of change

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:
0
Statement-level optimization hints.
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:
blank
No access path i specified for the statement, but optimization parameters exist in SYSQUERYOPTS
Y
Start of changeAn access path is specified in SYSQUERYPLAN for the statement. The access path is also valid if the statement has already been executed and the access path was used.End of change
N
Start of changeA an access path is specified in SYSQUERYPLAN, but the access path is invalid and not used.End of change
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
 
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 came from the basic machine-readable material (MRM) tape. 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
Start of changeThe 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:
  • Blanks including leading and trailing blanks, and embedded blanks that are not within literal strings between pairs of quotation mark symbols
  • White space, including leading and trailing white space, and white space that is not within a literal string between a pair of quotation mark symbols
  • SQL comments
  • EXPLAIN clauses
End of change
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
End of change