Monitoring PDQ threads with onstat utility commands

You can obtain information about all of the threads that are running for a decision-support query by running the onstat -u and onstat -g ath commands.

The onstat -u option lists all the threads for a session. If a session is running a decision-support query, the output lists the primary thread and any additional threads. For example, session 10 in onstat -u output has a total of five threads running.

Figure 1: onstat -u output
Userthreads
address  flags   sessid   user     tty      wait     tout locks nreads   nwrites
80eb8c   ---P--D 0        informix -        0        0    0     33       19
80ef18   ---P--F 0        informix -        0        0    0     0        0
80f2a4   ---P--B 3        informix -        0        0    0     0        0
80f630   ---P--D 0        informix -        0        0    0     0        0
80fd48   ---P--- 45       chrisw   ttyp3    0        0    1     573      237
810460   ------- 10       chrisw   ttyp2    0        0    1     1        0
810b78   ---PR-- 42       chrisw   ttyp3    0        0    1     595      243
810f04   Y------ 10       chrisw   ttyp2    beacf8   0    1     1        0
811290   ---P--- 47       chrisw   ttyp3    0        0    2     585      235
81161c   ---PR-- 46       chrisw   ttyp3    0        0    1     571      239
8119a8   Y------ 10       chrisw   ttyp2    a8a944   0    1     1        0
81244c   ---P--- 43       chrisw   ttyp3    0        0    2     588      230
8127d8   ----R-- 10       chrisw   ttyp2    0        0    1     1        0
812b64   ---P--- 10       chrisw   ttyp2    0        0    1     20       0
812ef0   ---PR-- 44       chrisw   ttyp3    0        0    1     587      227
 15 active, 20 total, 17 maximum concurrent

The onstat -g ath output also lists these threads and includes a name column that indicates the role of the thread. Threads that a primary decision-support thread started have a name that indicates their role in the decision-support query. For example, onstat -g ath Output lists four scan threads, started by a primary thread (sqlexec).

Figure 2: onstat -g ath Output
Threads:
tid     tcb     rstcb   prty    status                  vp-class   name
...
11      994060   0        4     sleeping(Forever)         1cpu    kaio
12      994394   80f2a4   2     sleeping(secs: 51)        1cpu    btclean
26      99b11c   80f630   4     ready                     1cpu    onmode_mon
32      a9a294   812b64   2     ready                     1cpu    sqlexec
113     b72a7c   810b78   2     ready                     1cpu    sqlexec
114     b86c8c   81244c   2     cond wait(netnorm)        1cpu    sqlexec
115     b98a7c   812ef0   2     cond wait(netnorm)        1cpu    sqlexec
116     bb4a24   80fd48   2     cond wait(netnorm)        1cpu    sqlexec
117     bc6a24   81161c   2     cond wait(netnorm)        1cpu    sqlexec
118     bd8a24   811290   2     ready                     1cpu    sqlexec
119     beae88   810f04   2     cond wait(await_MC1)      1cpu    scan_1.0
120     a8ab48   8127d8   2     ready                     1cpu    scan_2.0
121     a96850   810460   2     ready                     1cpu    scan_2.1
122     ab6f30   8119a8   2     running                   1cpu    scan_2.2