SYSQUERYSEL catalog table

The SYSQUERYSEL table contains information about the selectivity of predicates for queries in the SYSQUERY table that have been identified for extended optimization. It correlates to the SYSQUERY table by the QUERYID column. The schema is SYSIBM.

Table 1. SYSIBM.SYSQUERYSEL table column descriptions
Column name Data type Description Use
QUERYID
BIGINT
NOT NULL
The identifier of the query. S
QUERYNO
INTEGER
NOT NULL
A number that identifies the statement that is being explained. The origin of the value depends on the context of the row:
For rows produced by EXPLAIN statements
The number specified in the QUERYNO clause, which is an optional part of the SELECT, INSERT, UPDATE, MERGE, and DELETE statement syntax.
For rows not produced by EXPLAIN statements
Db2 assigns a number that is based on the line number of the SQL statement in the source program.

When the values of QUERYNO are based on the statement number in the source program, values that exceed 32767 are reported as 0. However, in certain rare cases, the value is not guaranteed to be unique.

S
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. S
APPLNAME
VARCHAR(24)
NOT NULL
The name of the application plan for the row. Applies only to embedded EXPLAIN statements that are executed from a plan or to statements that are explained when binding a plan. A blank indicates that the column is not applicable. S
PROGNAME
VARCHAR(128)
NOT NULL
The name of the program or package containing the statement being explained. Applies only to embedded EXPLAIN statements and to statements explained as the result of binding a plan or package. A blank indicates that the column is not applicable. S
SECTNOI
INTEGER
NOT NULL
The section number of the statement. The value is taken from the same column in SYSPACKSTMT or SYSSTMT tables and can be used to join tables to reconstruct the access path for the statement. This column is applicable only for static statements. S
COLLID
VARCHAR(128)
NOT NULL
The collection ID:
DSNDYNAMICSQLCACHE
The row originates from the dynamic statement cache
DSNEXPLAINMODEYES
The row originates from an application that specifies YES for the value of the CURRENT EXPLAIN MODE special register.
DSNEXPLAINMODEEXPLAIN
The row originates from an application that specifies EXPLAIN for the value of the CURRENT EXPLAIN MODE special register.
When the SQL statement is embedded in a non-inline SQL function or native SQL procedure, this column is not used and is blank.
S
VERSION
VARCHAR(122)
NOT NULL
The version identifier for the package. Applies only to an embedded EXPLAIN statement executed from a package or to a statement that is explained when binding a package. A blank indicates that the column is not applicable.

When the SQL statement is embedded in a non-inline SQL function or native SQL procedure, this column is not used and is blank.

S
PREDNO
INTEGER
NOT NULL
Identifies the predicate S
INSTANCE
SMALLINT
NOT NULL
The selectivity instance, which is used to group related selectivities. S
SELECTIVITY
FLOAT
NOT NULL
The selectivity of the predicate. S
WEIGHT
FLOAT (4)
NOT NULL
The weight of the selectivity instance. For example, a value of .25 means that 25% of the time when a query is executed the predicate will have this selectivity. S
ASSUMPTION
VARCHAR(128)
NOT NULL
Indicates how the selectivity was estimated, or will be used: One of the following values:
'NORMAL'
Estimated using the normal selectivity assumptions.
'OVERRIDE'
To be used as input to the Optimizer and override it's selectivity estimation.
S
INSERT_TIME
TIMESTAMP
NOT NULL
GENERATED ALWAYS
AS ROW CHANGE
TIMESTAMP
The time when the row was inserted. S
EXPLAIN_TIME
TIMESTAMP
The time when the EXPLAIN information was captured:
All cached statements
When the statement entered the cache, in the form of a full-precision timestamp value.
Non-cached static statements
When the statement was bound, in the form of a full precision timestamp value.
Non-cached dynamic statements
When EXPLAIN was executed, in the form of a value equivalent to a CHAR(16) representation of the time appended by 4 zeros.
S
REMARKS
VARCHAR(762)
Internal use only. S