Skip to main content
A number of virtual collections are available in the system namespace to monitor the DQL environment & peer information, and to provide statement diagnostics.

SYSTEM:ACTIVE_REQUESTS

ACTIVES is an alias for ACTIVE_REQUESTS.
Reports information on currently executing requests. The information is dynamic and will change as request processing takes place.
SELECT * FROM system:active_requests
The output includes dynamic timing information and the query execution plan which can be useful when diagnosing issues. Some points to note about the content:
  1. When executing in an environment with multiple subscription servers, only data from the servicing server is reported.
  2. It is expected to see any query retrieving data from active_requests in the output in “executing” state.
  3. Operators will record information whilst processing so it is normal to see changes in the content for active_requests.
  4. Zero values (times, counts) are omitted from the output.

SYSTEM:ALL_COLLECTIONS

Reports all collections in all namespaces.
SELECT * FROM system:all_collections

SYSTEM:COLLECTIONS

Reports all collections in the default namespace.
SELECT * FROM system:collections

SYSTEM:DATA_SYNC_INFO

Reports statistics related to data sync operations.
SELECT * FROM system:data_sync_info

SYSTEM:DQL_INDEXES

Reports the user defined indexes (Ditto SDK only).
SELECT * FROM system:indexes

SYSTEM:DUAL

Contains a single document with a single field. It can be used to execute and test DQL statements.
SELECT * FROM system:dual

SYSTEM:REQUEST_HISTORY

Records information about requests that have completed. This is the same basic information as reported by active_requests. Information is only recorded when some aspect of the request execution meets the user-configurable qualifiers. (See configuration.)
SELECT * FROM system:request_history
The output includes complete timing information and the query execution plan, along with the qualifier that resulted in the request information being captured, all of which can be useful when diagnosing issues. request_history has a configurable maximum number of documents it will keep with oldest being dropped when attempting to add beyond the limit. (See configuration.) Some points to note about the content:
  1. When executing in an environment with multiple subscription servers, only data from the servicing server is reported.
  2. There should not be any requests in request_history in “executing” state
    1. The state should reflect the final state of the request: successful completion or failure.
  3. Zero values (times, counts) are omitted from the output.
The cache content may be (selectively) cleared with a DELETE statement. See also: Diagnosing problems

SYSTEM:SYSTEM_INFO

Reports a system information dump’s contents.
SELECT * FROM system:system_info

SYSTEM:TRANSPORTS_INFO

Reports available transports information.
SELECT * FROM system:transports_info

SYSTEM:VITALS

Reports overview statistics about the query engine. It is typically the starting point for general query engine diagnostics. When executing in an environment with multiple subscription servers, only data from the servicing server is reported.
SELECT * FROM system:vitals
Some points to note about the content:
  1. The histograms decay over a 15 minute interval.
  2. “other” is all statements not covered by the individual metrics, e.g. ALTER SYSTEM
  3. All timings are in nanoseconds

Configuration

Where appropriate, the virtual collections content is determined by configuration settings allowing a user some control over what information is available.

Request History

The system:request_history collection’s size is determined by the DQL_REQUEST_HISTORY_SIZE system parameter, defaulting to 4096, indicating the number of entries to retain. The larger the size and the larger the statements captured, the greater the memory use.
ALTER SYSTEM SET dql_request_history_size = 5000
Which statements qualify for inclusion in the system:request_history collection is determined by the DQL_REQUEST_HISTORY_QUALIFIERS system parameter which can be set to an object listing all desired qualifiers. Qualifiers not included in the object are removed (or reset). The following qualifiers can be set:
  1. threshold - the total execution time in milliseconds over which qualifies the request for inclusion. This is set by default to 1000 (1 second) and is always active. It can be set to 0 to include all statements.
  2. failed - if a statement’s execution fails. true by default.
  3. system_delete - any delete statement run against a system namespace collection. true by default.
  4. mutation - if a statement is a mutation of any sort. Not active (false) by default.
ALTER SYSTEM SET dql_request_history_qualifiers = { "threshold": 500, "failed": false }

Diagnosing problems

Profile analysis

The profile (#stats elements added to the plan) information permits assessment of where in the execution the time was spent and is therefore useful in directing next steps. request_history entries show how many results the statement and each of its operators processed. This may give insight into what may need to be changed in a statement. Analysis of the profile from multiple runs of the same statement may highlight things like selectivity-skew in filter values.
Any definition of “high” times should be with respect to the volume of data processed.
Some possible indications from profile analysis include:
  1. Stalled execution: If a request appears in the active_requests output but doesn’t appear to be making any progress it likely indicates an issue with the earliest (apart from sequence) operator in the plan.
    1. Commonly indicated by unchanging document counts anywhere in the profile.
  2. Excessive processing: An operator with a high document count potentially indicates this.
    1. Possibly a filter isn’t as selective as thought, etc.
    2. It may also show where “dam” operators are requiring all prior plan processing to complete before the remainder of the plan can run.
      1. e.g. a GROUP BY needs all input records before it can begin emitting the groups.
  3. Data access issues: Underlying collection access issues may be indicated by high scan operator receive times.
    1. High scan or fetch times are potentially indicative of collection access issues.
    2. High index scan receive times are potentially indicative of index access issues.
  4. Selectivity issues: Indications of index selectivity as compared to the entire predicate’s selectivity may be highlighted with a large number of documents being excluded by the filter operator.
    1. The difference in document in & out counts for the filter operator indicate the filtering taking place.
      1. A large amount of filtering may not indicate a problem if there are filters that cannot be applied by index scans.
      2. A large amount of filtering may indicate the query would benefit from different or additional indexes.
  5. Memory requirements: Document counts for operators that must process the entire prior pipeline - such as sorting and grouping - may give an indication of which statements will have larger memory requirements.
Further:
  1. Bottlenecks downstream in a plan may be indicated by a high operator send time.
    1. This may be observed for any operator and attention should be focused on later operators.
  2. Bottlenecks upstream in a plan may be indicated by a high operator recv time.
    1. This may be observed for any operator and attention should be focused on earlier operators.
  3. Possible problems in an operator may be highlighted by a high exec time.
    1. This must be considered in conjunction with the number of documents being processed.
    2. Operator issues should be reported via support channels.

SYSTEM:ACTIVE_REQUESTS & SYSTEM:REQUEST_HISTORY

When initially developing DQL statements the explain statement is used to determine the execution plan a query will use. Once deployed it may not always be possible to revert to examination of such a plan or there might be concern that the plan has materially changed. The system:active_requests and system:request_history collections contain1 instances of the actual execution plan used by a request, annotated with timing and document count information. These can be used to discover where in the execution a statement is taking time and can highlight things like unexpectedly low selectivity of filters or failure to find a suitable index.
Sometimes it may be possible to execute a statement directly when diagnosing issues. The PROFILE keyword appends the request_history entry (without having to pass qualification) to the statement’s results. This allows dynamic access all the same information as is included in request_history without having to capture a live instance of its execution.
PROFILE SELECT make FROM cars WHERE year > 2000
Producer operators are executed in parallel with their consumers and may show a much higher "documentsOut" count than the consumer’s "documentsIn". For completed requests, this is an indication that the consumer has stopped processing early and has not processed all of the documents sent by the producer. This might be perfectly normal, for instance when a LIMIT operator has hit the document count and has therefore stopped processing, or it may be that a downstream operator has encountered an error and has stopped the statement execution as a result.
      [...]
      "#operator": "sequence",
      "children": [
        {
          "#operator": "scan",
          "#stats": {
[1]         "documentsOut": 11,
            "phaseTimes": {
              "exec": 21792,
              "recv": 2595000,
              "send": 594043
            }
          },
          "collection": "all_collections",
          "datasource": "system"
        },
        {
          "#operator": "limit",
          "#stats": {
[1]         "documentsIn": 2,
            "documentsOut": 1,
            "phaseTimes": {
              "exec": 9333,
              "recv": 3547625,
              "send": 145375
            }
          },
          "limit": 1
        }
      ]
    },
    [...]

1. Currently only available for select statements.