MON_GET_RTS_RQST table function - Retrieve information about real-time statistics requests

The MON_GET_RTS_RQST table function returns information about all real-time statistics requests that are pending in the system and the set of requests that are currently being processed by the real-time statistics daemon, such as on the real-time statistics processing queue.

Syntax

Read syntax diagramSkip visual syntax diagramMON_GET_RTS_RQST()

The schema is SYSPROC.

Authorization

You require one of the following types of authorization to execute the routine:
  • EXECUTE privilege on the routine
  • DATAACCESS authority
  • DBADM authority
  • SQLADM authority

Default PUBLIC privilege

None

Example

The following query displays all pending and currently queued or executing real-time statistics requests:

SELECT MEMBER,
       QUEUE_POSITION,
       REQUEST_STATUS,
       REQUEST_TYPE,
       OBJECT_TYPE,
       VARCHAR(OBJECT_SCHEMA, 10) AS SCHEMA,
       VARCHAR(OBJECT_NAME, 10) AS NAME
FROM TABLE(MON_GET_RTS_RQST()) AS T
ORDER BY MEMBER, QUEUE_POSITION ASC

Following is an example of output from this query:

MEMBER QUEUE_POSITION REQUEST_STATUS REQUEST_TYPE    OBJECT_TYPE SCHEMA    NAME
------ -------------- -------------- --------------- ----------- --------- -------
     0              1 EXECUTING      COLLECT_STATS   TABLE       TEST      EMPLOYEE
     0              2 QUEUED         COLLECT_STATS   TABLE       TEST      T1
     0              3 QUEUED         WRITE_STATS     TABLE       TEST      T3
     0              - PENDING        WRITE_STATS     TABLE       TEST      BLAH
     1              - PENDING        COLLECT_STATS   TABLE       TEST      DEPT
     1              - PENDING        WRITE_STATS     TABLE       TEST      SALES
     2              - PENDING        WRITE_STATS     TABLE       TEST      SALARY

7 record(s) selected.

Usage notes

The MON_GET_RTS_RQST table function returns information about all real-time statistics requests that are pending on all members. The queue for processing real-time statistics requests exists only on a single member.

The MON_GET_RTS_RQST table function does not report any real-time statistics requests if real-time statistics collection is not enabled.

Information returned

Table 1. Information returned for MON_GET_RTS_RQST function
Column name Data type Description
OBJECT_TYPE VARCHAR(8) Type of object, which is one of the following values:
  • TABLE
  • VIEW
OBJECT_SCHEMA VARCHAR(128) object_schema - Object schema monitor element
OBJECT_NAME VARCHAR(128) object_name - Object name monitor element
MEMBER SMALLINT member - Database member monitor element
REQUEST_TYPE VARCHAR(14) One of the following values:
WRITE_STATS
Request is to write already collected statistics to the catalogs.
COLLECT_STATS
Request is to perform full statistics collection.
REQUEST_STATUS VARCHAR(10) One of the following values:
PENDING
Request is waiting to be picked up by the real-time statistics daemon.
QUEUED
Request was gathered by the real-time statistics daemon and is awaiting processing.
EXECUTING
Request is currently being processed by the real-time statistics daemon.
REQUEST_TIME TIMESTAMP Time that the request was submitted.
QUEUE_POSITION INTEGER If the value of the REQUEST_STATUS column is QUEUED, the position of the request in the real-time statistics daemon processing queue.
QUEUE_ENTRY_TIME TIMESTAMP If the value of the REQUEST_STATUS column is QUEUED, the time that the request was added to the real-times statistics daemon processing queue.
EXECUTION_START_TIME TIMESTAMP If the value of the REQUEST_STATUS column is EXECUTION, the time that the request began execution; NULL otherwise.
TENANT_ID BIGINT tenant_id - Tenant identifier monitor element