SQL in thread stacks
mat_sql_in_threadsScan thread stacks in a parsed heap dump for JDBC PreparedStatement objects and SQL strings to find long-running or heavy queries held by threads at OOM time, filtering harmless heartbeat SQL.
Instructions
Read-only scan of thread stacks for JDBC PreparedStatement objects and SQL strings, used to spot long-running or heavy queries held by threads at OOM time. Requires the report_id of a parsed dump (status=DONE). Results are sorted risky-first, then by the owning thread's retained heap, and include threadId, threadName, threadRetainedBytes, frame, source, objectId, sql, risk (risky|harmless|unknown), and reason. With onlyRisky=true, heartbeat/validation statements such as SELECT 1, SELECT 'x', /* ping */ and VALUES(1) are filtered out; pass onlyRisky=false to see all SQL-like strings.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| onlyRisky | No | true (default) drops harmless heartbeat/validation SQL (SELECT 1, SELECT 'x', /* ping */, VALUES(1)); false returns every SQL-like string found. | |
| report_id | Yes | Report ID returned by open_heapdump or dump_java_heap; the dump must have finished parsing (status must be DONE). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |