List Statistics Collections (QDBSTLS, QdbstListStatistics) API


  Required Parameter Group:


  Service Program Name: QDBSTMGR

  Default Public Authority: *USE

  Threadsafe: Yes

The List Statistics Collections (QDBSTLS, QdbstListStatistics) API allows to find out all of the columns and combination of columns for a given file member, which have statistics available and will optionally list those columns, not contained in any statistics collection. The generated list replaces any existing list in the user space.

Each returned list entry contains a number of different statistic data items, including the number of histogram ranges and the number of most frequent values, while detailed information for these two items can be retrieved using the List Statistics Collection Details (QDBSTLDS, QdbstListDetailStatistics) API, using the internal statistics ID returned by the QdbstListStatistics API.

The QdbstListStatistics API also allows to list statistics related attributes at the file member level, not related to a single statistics collection.


Section overview


Authorities and Locks

User Space Authority
*CHANGE
User Space Library Authority
*EXECUTE
User Space Lock
*EXCLRD
ASP Device Authority
*EXECUTE
File Authority
*OBJOPR
File Library Authority
*EXECUTE
File Lock
*SHRRD

Required Parameter Group

Qualified user space name
INPUT; CHAR(20)

The user space that is to receive the generated list, and the library in which it is located. The first 10 characters contain the user space name, and the second 10 characters contain the library name.

You can use these special values for the library name:


Format of output
INPUT; CHAR(8)

The format of the statistics collections list to be returned. If format STOL0100 is specified, the fields that were selected by the caller will be returned for each statistics collection in the list. Possible format names are:

Refer to Format of the Generated List and STOL0100 Output Format for more information.

Input data
INPUT; CHAR(*)

The buffer containing the input parameters according to the format of input data parameter. The buffer content has to start at a four-byte boundary.

Length of input data
INPUT; BINARY(4)

The length of the input data buffer provided.

Format of input data
INPUT; CHAR(8)

The format of the input data. Possible values are:

Refer to STIL0100 Input Format for more information.

Error code
I/O; CHAR(*)

The structure in which to return error information. For the format of the structure, see Error code parameter.


STIL0100 Input Format

List statistics collections input parameters. See Field Descriptions for details of the fields listed.



Valid Keys - Request Output

The keys listed below are used to determine in the STIL0100 Input Format what will be returned per list entry in the List Data Section - STOL0100 Output Format. Each key can only be specified once. See Field Descriptions for details of the fields listed.

Each list entry returned in the output format describes a single statistics collection for a specific file member and can be thought of as two groups of related keys:

Group 1: The following keys describe information at file member level and will repeat in list entries describing different statistics collections (see group 2) for the same file member:

Group 2: The following keys describe information at statistics collection level per file member:



Format of the Generated List

The statistics collections list consists of:

The user area and generic header are described in User spaces. The remaining items are described in the following sections.


Input Parameter Section

The following information is returned in the input parameter section. For detailed descriptions of the fields in this table, see Field Descriptions.



Header Section

For detailed descriptions of the fields in this table, see Field Descriptions.



List Data Section - STOL0100 Output Format

For output format STOL0100, the list data section has the following layout, where each list entry contains the requested fields for a single statistics collection for a specific file member. See also Valid Keys - Request output and note, that the fields for each list entry will be returned in the order requested.

See Field Descriptions for details of the fields listed in the layout.



Column Description

Layout of a single returned column description, if Column descriptions were requested as output in the STIL0100 Input Format. See Field Descriptions for details of the fields listed.



Field Descriptions

Aging mode. Whether the system is allowed to age or remove the statistics collection. The possible values are:

Aging status. How current the statistics data is. The possible values are:

ASP device name. The name of one auxiliary storage pool (ASP) device in the ASP group in which the library and file are located. The ASP device must have a status of 'Available'. The documented authority is required for the given ASP and the primary of the corresponding ASP group. The name can be a specific ASP device name (for an ASP with a number greater than 32), or one of the following special values:

ASP device name used. The actual auxiliary storage pool device name used, after possible resolution of special values.

CCSID. The column CCSID for character type columns.

Column descriptions. The array of detailed column descriptions in the same order as the columns were requested. The array dimension is given by the Number of Columns field. See Column description for the layout of a single column description.

Column names. The array of names of the columns within the statistics collection, in the same order as at request time. The array dimension is given by the Number of Columns field.

Column option. Which columns and combination of columns to include in the list. The possible values are:

Column text. The character string supplied with the LABEL ON SQL statement for this column.

Continuation handle (input section). The handle used to continue from a previous call to this API that resulted in partially complete information. You can determine if a previous call resulted in partially complete information by checking the Information Status variable in the generic user space header following the API call.

If the API is not attempting to continue from a previous call, this parameter must be set to blanks. Otherwise, a valid continuation value must be supplied. The value may be obtained from the list header section of the user space used in the previous call. When continuing, the first entry in the returned list is the entry that immediately follows the last entry returned in the previous call.

Continuation handle (header section). A continuation point for the API. This value is set based on the contents of the Information Status variable in the generic header for the user space. The following situations can occur:

Current block system statistics collections option. Whether system initiated (automatic) statistics collection create requests are allowed for this database file member. The possible values are:

Current number of deleted records. The total count of deleted records in the file member at the time of the list request.

Current number of (undeleted) records. The total count of active records in the file member at the time of the list request.

Current size of statistics collections. The total amount of space in bytes used for statistics collections related data for this file member.

Current time stamp of last change. The time stamp, when the file member was last changed at the time of the list request.

Current total count of inserts, updates, and deletes. The number of insert, update, and delete operations that were recorded for the file member at the time of the list request.

Data. The data returned for the key identifier.

Displacement to specified fields to return. Displacement to the start of the array of specified fields to return.

Note: This is not the offset specified on input, but the displacement within the input parameter section. See the Offset to fields to return specified instead.

Field length. Column field length.

File library name. Where the file for which statistics collections are to be listed is located. You can use these special values for the library name, if the ASP Device Name is *:

File library name used. The actual file library name used, after possible resolution of special values.

File member name. The name of the file member to be used for the list request. This value can be a specific file member name or one of the following special values:

File member name used. The actual file member name used, after possible resolution of special values.

File name. The name of the file for which statistics collections are to be listed. This can be a name of an existing local, single format, physical file. If an actual name is specified for the file library name, then you can also use the special value:

File name used. The actual file name used.

Has default. Whether the column has a default value (DEFAULT clause or null capable). The possible values are:

Internal statistics ID. Together with the qualified file name and member name this represents a unique ID for the statistics collection listed.

Note: The ID is stored in binary, non printable form in the character array.

Key identifier. The field returned. For a list of valid keys see Valid Keys - Request output.

Keys of fields to return. The list of fields to return per list entry. For a list of valid keys see Valid Keys - Request output.

Length in bytes. Column length in bytes.

Length of data. The length of the data returned for the field.

Length of field information returned. Total number of bytes returned for this field.

Length of list entry. Number of bytes returned for this list entry.

Name of creating user profile. The name of the user profile, which requested the statistics collection. The name will be *SYS for statistics collections automatically requested by the system.

Name of last modifying user profile. The name of the user profile, which updated the statistics collection data last. The name will be *SYS for statistics collections automatically refreshed by the system.

Note: Updates of statistics collection attributes will not be logged here.

NULL capable. whether the column allows NULL values or not. The possible values are:

Number of columns. Number of columns within the single statistics collection.

Number of deleted records. The total count of deleted records in the file member at the time the statistics were collected.

Number of distinct values. The estimated number of distinct (non NULL) values found in the statistics collection key.

Number of fields to return. The number of fields to return for each list entry.

Number of histogram ranges available. The number of histogram ranges available for this statistics collection. The actual histogram range values can be obtained using the List Statistics Collection Details (QDBSTLDS, QdbstListDetailStatistics) API.

Number of key fields returned. Number of fields actually returned.

Number of most frequent values available. The number of most frequent values available for this statistics collection. The actual most frequent values can be obtained using the List Statistics Collection Details (QDBSTLDS, QdbstListDetailStatistics) API.

Number of NULLs. The estimated number of NULL values found in the statistics collection key.

Number of (undeleted) records. The total count of active records in the file member at the time the statistics were collected.

Number of deleted records. The total count of deleted records in the file at the time the statistics were collected.

Offset to fields to return. Offset to the start of the array of fields to return.

Offset to fields to return specified. Offset to fields to return as specified on the call of the API.

Displacement to specified fields to return. Displacement to the start of the array of specified fields to return.

Note: This is not the offset specified on input, but the displacement within the input parameter section. See the Offset to fields to return specified instead.

Ordinal position. Numeric place of the column in the file member, ordered from left to right, starting with one.

Precision. The precision of the column for numeric data type columns.

Qualified translation table names. The array of names of the translation tables that were specified, when the statistics collection was requested, in the same order as requested. The first 10 characters contain the translation table name, and the second 10 characters contain the name of the library where the table is located. The array dimension is given by the number of columns field. The Translation table name can also have the following special values: *LANGIDUNQ indicates the unique weight table that corresponds to the LANGID specified in the library name is used; *LANGIDSHR indicates the shared weight table that corresponds to the LANGID specified in the library name is used.

Note: For system initiated requests, the translation table name and the library can be set to the special value:

Radix. whether the column precision is specified in number of binary or decimal digits for numeric data types columns. The possible values are:

Reserved. Reserved for future use. If this field is input, the field must be set to hexadecimal zeros.

Reserved (in STOL0100 Output format). Structure padding to guarantee alignment to the next four bytes boundary.

Scale. The scale of the column for numeric data type columns.

SQL data type. The SQLTYPE of the column as explained in the DB2® for IBM® i SQL reference topic collection.

Statistics collection name. A name unique amongst all statistics collections for the file member.

Time stamp of create. The time stamp, when the statistics collection was created.

Time stamp of last modification. The time stamp, when the statistics collection was last modified. This includes the initial create and any update of the statistics collection data.

Note: Updates to just statistics collection attributes will not be logged here.

Total count of inserts, updates, and deletes. The number of insert, update, and delete operations that were recorded for the file member at the time the statistics were collected.

Translation attribute. Indicates the type of translation used on the combination of character columns in the statistics collection key before the statistics were calculated. This attribute generalizes the information given by the the single translation attribute values returned for each column. The possible values are:

Translation attributes. The array of translation attributes for the single columns in the statistics collection key in the same order as requested. The translation attribute indicates the type of translation used on a character column before the statistics were calculated and generalizes the type of translation defined by the translation table applied to this column. The possible values for each array entry are:

User space name specified. User space name as specified on the call of the API.

User space library name specified. User space library name as specified on the call of the API.



Error Messages



Related Information



API introduced: V5R2

[ Back to top | >Database and File APIs | APIs by category ]