sql: cumulative workload and queryid profile
Rank cumulative SQL workload and inspect a signed queryid profile.
Find top cumulative statements from sys_stat_statements (sql / sql top), then inspect one signed 64-bit queryid profile and its matching active sessions (sql show). Read-only: never runs online EXPLAIN.
Usage
Subcommands & Options
| Option | Effect |
|---|---|
sql / sql top | Rank cumulative statements (--by=time|mean|calls|io|temp, --limit N) |
sql show --id=<int64> | Show one statement’s cumulative metrics plus live sessions sharing queryid |
--sql-db, --sql-user | Filter statement rows without changing the connection’s -d / -U |
--json | Emit structured JSON (sql.top, sql.show, sql.show.active) |
Verdict & Reading Output
OK(exit=0): Collected requested cumulative metrics and active match status cleanly; equalqueryidentries across different(dbid, userid)pairs stay separate, never summed.UNKNOWN(exit=3):sys_stat_statementsmissing/track=nonewith no rows, hiddenqueryidfor non-monitoring accounts, or missingsys_stat_activity.queryidcapability (e.g. KES V8R6, wheresql showexplicitly marks active matching unavailable).- Cumulative window caveat: Counters accumulate since the last statistics reset (or retain older rows when
sys_stat_statements.track=none).
Example (KES V9 Primary, COLUMNS=80)
Related Commands
kbdiag session— inspect live PID details (sqlactivity, waits, locks)kbdiag lock— check whether top execution time comes from lock contentionkbdiag space— inspect temp file / disk headroom whentemporioleads