SYSIBM.SYSQUERYPLAN table
The SYSIBM.SYSQUERYPLAN table contains the plan hint information for the queries in the SYSIBM.SYSQUERY table. It correlates to the SYSIBM.SYSQUERY table by the QUERYID column. For a query, there can be up to 3 copies of plan hints stored in the SYSIBM.SYSQUERYPLAN table, distinguished by the value of the COPYID column.
Column name | Data type | Description | Use |
---|---|---|---|
QUERYID | BIGINT
NOT NULL ON DELETE CASCADE |
Unique identifier for the query. The value of QUERYID corresponds to the value of the QUERYID column in the SYSIBM.SYSQUERY column. | G |
COPYID | SMALLINT
NOT NULL |
The version of the plan
hints for the query in this row.
|
G |
PLAN_VALID | CHAR(1)
NOT NULL |
Whether the plan hints are valid:
|
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. |
G |
QBLOCKNO | SMALLINT
NOT NULL |
A number that identifies each query block within a query. The value of the numbers are not in any particular order, nor are they necessarily consecutive. | G |
PLANNO | SMALLINT
NOT NULL |
The number of the step in which the query that is indicated in QBLOCKNO was processed. This column indicates the order in which the steps were executed. | G |
METHOD | SMALLINT
NOT NULL |
A number that indicates the join method that is
used for the step:
|
G |
CREATOR | VARCHAR(128)
NOT NULL |
The creator of the new table that is accessed in this step, blank if METHOD is 3. | G |
TNAME | VARCHAR(128)
NOT NULL |
The
name of one of the following objects:
|
G |
SMALLINT
NOT NULL |
Values are for IBM® use only. | I | |
ACCESSTYPE | CHAR(2)
NOT NULL |
The method of accessing the new table:
|
G |
MATCHCOLS | SMALLINT
NOT NULL |
For ACCESSTYPE I, I1, N, NR, MX, or DX, the number of index keys that are used in an index scan; otherwise, 0. | G |
ACCESSCREATOR | VARCHAR(128)
NOT NULL |
For ACCESSTYPE I, I1, N, NR, MX, or DX, the creator of the index; otherwise, blank. | G |
ACCESSNAME | VARCHAR(128)
NOT NULL |
For ACCESSTYPE I, I1, H, MH, N, NR, MX, or DX, the name of the index; for ACCESSTYPE P, DSNPJW(mixopseqno) is the starting pair-wise join leg in MIXOPSEQNO; otherwise, blank. |
G |
INDEXONLY | CHAR(1)
NOT NULL |
Indication of whether access to an
index alone is enough to perform the step, or Indication of whether
data too must be accessed.
|
G |
SORTN_UNIQ | CHAR(1)
NOT NULL |
Indication of whether the new table
is sorted to remove duplicate rows.
|
G |
SORTN_JOIN | CHAR(1)
NOT NULL |
Indication of whether the new table
is sorted for join method 2 or 4.
|
G |
SORTN_ORDERBY | CHAR(1)
NOT NULL |
Indication of whether the new table
is sorted for ORDER BY.
|
G |
SORTN_GROUPBY | CHAR(1)
NOT NULL |
Indication of whether the new table
is sorted for GROUP BY.
|
G |
SORTC_UNIQ | CHAR(1)
NOT NULL |
Indication of whether the composite
table is sorted to remove duplicate rows.
|
G |
SORTC_JOIN | CHAR(1)
NOT NULL |
Indication of whether the composite
table is sorted for join method 1, 2 or 4.
|
G |
SORTC_ORDERBY | CHAR(1)
NOT NULL |
Indication of whether the composite
table is sorted for an ORDER BY clause or a quantified predicate.
|
G |
SORTC_GROUPBY | CHAR(1)
NOT NULL |
Indication of whether the composite
table is sorted for a GROUP BY clause.
|
G |
TSLOCKMOD | CHAR(3)
NOT NULL |
An indication of the mode of lock
that is acquired on either the new table, or its table space or table
space partitions. If the isolation can be determined at bind time,
the values are:
The data in this column is right justified. For example, IX appears as a blank, followed by I, followed by X. If the column contains a blank, then no lock is acquired. If the access method in the ACCESSTYPE column is DX, DI, or DU, no latches are acquired on the XML index page and no lock is acquired on the new base table data page or row, nor on the XML table and the corresponding table spaces. The value of TSLOCKMODE is a blank in this case. |
G |
PREFETCH | CHAR(1)
NOT NULL |
Indication
of whether data pages are to be read in advance by prefetch:
|
G |
COLUMN_FN_EVAL | CHAR(1)
NOT NULL |
When an SQL aggregate function is
evaluated:
|
G |
MIXOPSEQ | SMALLINT
NOT NULL |
The sequence number of a step in a
multiple index operation.
|
G |
ACCESS_DEGREE | SMALLINT
|
The number of parallel tasks or operations that are activated by a query. This value is determined at bind time; the actual number of parallel operations that are used at execution time could be different. This column contains 0 if a host variable is used. This column contains the null value if the plan or package was bound using a plan table with fewer than 43 columns. Otherwise, it can contain null if the method that it refers to does not apply. | G |
ACCESS_PGROUP_ID | SMALLINT
|
The identifier of the parallel group for accessing the new table. A parallel group is a set of consecutive operations, executed in parallel, that have the same number of parallel tasks. This value is determined at bind time; it could change at execution time.This column contains the null value if the plan or package was bound using a plan table with fewer than 43 columns. Otherwise, it can contain null if the method that it refers to does not apply. | G |
JOIN_DEGREE | SMALLINT
|
The number of parallel operations or tasks that are used in joining the composite table with the new table. This value is determined at bind time and can be 0 if a host variable is used. The actual number of parallel operations or tasks used at execution time could be different. This column contains the null value if the plan or package was bound using a plan table with fewer than 43 columns. Otherwise, it can contain null if the method that it refers to does not apply. | G |
JOIN_PGROUP_ID | SMALLINT
|
The identifier of the parallel group for joining the composite table with the new table. This value is determined at bind time; it could change at execution time. This column contains the null value if the plan or package was bound using a plan table with fewer than 43 columns. Otherwise, it can contain null if the method that it refers to does not apply. | G |
SORTC_PGROUP_ID | SMALLINT
|
The parallel group identifier for the parallel sort of the composite table. This column contains the null value if the plan or package was bound using a plan table with fewer than 43 columns. Otherwise, it can contain null if the method that it refers to does not apply. | G |
SORTN_PGROUP_ID | SMALLINT
|
The parallel group identifier for the parallel sort of the new table. This column contains the null value if the plan or package was bound using a plan table with fewer than 43 columns. Otherwise, it can contain null if the method that it refers to does not apply. | G |
PARALLELISM_
MODE |
CHAR(1)
|
The kind of parallelism, if any, that
is used at bind time:
|
G |
MERGE_
JOIN_ COLS |
SMALLINT
|
The number of columns that are joined during a merge scan join (Method=2). This column contains the null value if the plan or package was bound using a plan table with fewer than 43 columns. Otherwise, it can contain null if the method that it refers to does not apply. | G |
CORRELATION_
NAME |
VARCHAR(128)
|
The correlation name of a table or view that is specified in the statement. If no correlation name exists, then the column is null. This column contains the null value if the plan or package was bound using a plan table with fewer than 43 columns. Otherwise, it can contain null if the method that it refers to does not apply. | G |
PAGE_RANGE | CHAR(1)
NOT NULL WITH DEFAULT |
Indication of whether the table qualifies
for page range screening, so that plans scan only the partitions that
are needed.
|
G |
JOIN_TYPE | CHAR(1)
NOT NULL WITH DEFAULT |
The type of join:
RIGHT OUTER JOIN converts to a LEFT OUTER JOIN when you use it, so that JOIN_TYPE contains L. |
G |
QBLOCK_TYPE | CHAR(6)
NOT NULL WITH DEFAULT |
For each query block, an indication of the type
of SQL operation that is performed. For the outermost query, this
column identifies the statement type. Possible values include:
|
G |
PRIMARY_
ACCESSTYPE |
CHAR(1)
NOT NULL WITH DEFAULT |
Indicates Indication of whether direct
row access is attempted first:
|
G |
PARENT_QBLOCKNO | SMALLINT
NOT NULL |
A number that indicates the QBLOCKNO of the parent query block. | G |
TABLE_TYPE | CHAR(1)
|
The type of new table:
The value of the column is null if the query uses GROUP BY, ORDER BY, or DISTINCT, which requires an implicit sort. |
G |
TABLE_ENCODE | CHAR(1)
|
The encoding scheme of the table. The possible
values are:
|
G |
TABLE_SCCSID | SMALLINT
NOT NULL WITH DEFAULT |
The SBCS CCSID value of the table. If column TABLE_ENCODE is M, the value is 0. | G |
TABLE_MCCSID | SMALLINT
NOT NULL WITH DEFAULT |
The mixed CCSID value of the table. If the value of the TABLE_ENCODE column is M, the value is 0. If MIXED=NO in the DSNHDECP module, the value is -2. | G |
TABLE_DCCSID | SMALLINT
NOT NULL WITH DEFAULT |
The DBCS CCSID value of the table. If the value of the TABLE_ENCODE column is M, the value is 0. If MIXED=NO in the DSNHDECP module, the value is -2. | G |
INTEGER
NOT NULL WITH DEFAULT |
The values in this column are for IBM use only. | I | |
CTEREF | SMALLINT
NOT NULL WITH DEFAULT |
If the referenced table is a common table expression, the value is the top-level query block number. | G |
PARENT_PLANNO | SMALLINT
NOT NULL |
Corresponds to the plan number in the parent query block where a correlated subquery is invoked. Or, for non-correlated subqueries, corresponds to the plan number in the parent query block that represents the work file for the subquery. | G |