DSN_PGRANGE_TABLE
The page range table, DSN_PGRANGE_TABLE, contains information about qualified partitions for all page range scans in a query.
Qualifiers
Your subsystem or data sharing group can
contain multiple instances of these tables that are qualified by user ID. These tables are populated
with statement cost information when you issue the EXPLAIN statement or bind. They are also
populated when you specify EXPLAIN(YES) or EXPLAIN(ONLY) in a BIND or REBIND command. SQL
optimization tools might also create EXPLAIN tables that are qualified by a user ID. You can find
the SQL statement for creating an instance of these tables in member DSNTESC of the SDSNSAMP
library.
Sample CREATE TABLE statement
You can find a sample CREATE TABLE statement for each EXPLAIN table in member DSNTESC of the prefix.SDSNSAMP library. You can call the ADMIN_EXPLAIN_MAINT stored procedure to create EXPLAIN tables, upgrade them to the format for the current Db2 release, or complete other maintenance tasks. See ADMIN_EXPLAIN_MAINT stored procedure for information about using the action input parameter to request each of these tasks.
Column descriptions
The following table describes the columns of DSN_PGRANGE_TABLE.
Column name | Data type | Description |
---|---|---|
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:
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.
|
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. |
TABNO | SMALLINT NOT NULL | The table number, a number which uniquely identifies the corresponding table reference within a query. |
RANGE | SMALLINT NOT NULL | The sequence number of the current page range. |
FIRSTPART | SMALLINT NOT NULL | The starting partition in the current page range. |
LASTPART | SMALLINT NOT NULL | The ending partition in the current page range. |
NUMPARTS | SMALLINT NOT NULL | The number of partitions in the current page range. |
EXPLAIN_TIME | TIMESTAMP NOT NULL | The
time when the EXPLAIN information was captured:
|
GROUP_MEMBER | VARCHAR(24) NOT NULL | The member name of the Db2 that executed EXPLAIN. The column is blank if the Db2 subsystem was not in a data sharing environment when EXPLAIN was executed. |
SECTNOI | INTEGER NOT NULL WITH DEFAULT | 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. The default value of -1 indicates EXPLAIN information that was captured in DB2® 9 or earlier. |
APPLNAME | VARCHAR(24) NOT NULL WITH DEFAULT | 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.
|
PROGNAME | VARCHAR(128) NOT NULL WITH DEFAULT | 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.
|
COLLID | VARCHAR(128) NOT NULL WITH DEFAULT | The collection ID:
|
VERSION | VARCHAR(122) NOT NULL WITH DEFAULT | 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.
![]() ![]() ![]()
![]() ![]() ![]() |
EXPANSION_REASON | CHAR(2) NOT NULL WITH DEFAULT |
This column applies only to statements that reference archive tables or temporal tables. For other statements, this column is blank.
Indicates the effect of the CURRENT TEMPORAL BUSINESS_TIME special register, the CURRENT TEMPORAL SYSTEM_TIME special register, and the SYSIBMADM.GET_ARCHIVE built-in global variable. These items are controlled by the BUSTIMESENSITIVE, SYSTIMESENSITIVE, and ARCHIVESENSITIVE bind options. Db2 implicitly adds certain syntax to the query if one of the following conditions are true:
This column can have one of the following values:
|
![]() ![]() |
![]() ![]() |
![]() For example, this column corresponds to the following catalog table columns that identify SQL statements:
![]() |
![]() ![]() |
![]() ![]() |
![]() ![]() |