timedQuery
timedQueryRun a read-only SQL query and return its rows plus elapsed time, with optional parameter binding and per-statement performance counters.
Instructions
Measure one read-only SQL SELECT / WITH / EXPLAIN while still returning its rows and elapsed time. Use executeQuery when timing is irrelevant or benchmarkQuery for repeated cold/warm measurements. Bind '?'->params, ':name'->namedParams; never mix. E.g. :status -> namedParams={status:'PAID'} — key is the bare name. Adds available per-statement counter deltas (calls, execution time, rows, buffer hits/reads).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| limit | No | Row limit (default JDBC_MAX_ROWS). | |
| params | No | Values for '?' placeholders, in order. | |
| connection | Yes | Database to run against. Call listConnections for valid names; do not guess. | |
| namedParams | No | Values for ':name' placeholders, keyed by name. | |
| timeoutSeconds | No | Timeout in seconds (default JDBC_QUERY_TIMEOUT_SECONDS). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | Returned result rows as column-name to value maps, capped by the requested limit. | |
| engine | No | Database engine that produced the result, such as PostgreSQL, Oracle, or SQL Server. | |
| columns | No | Result column names in output order. | |
| rowCount | Yes | ||
| elapsedMs | Yes | Wall-clock elapsed time for the query execution, in milliseconds. | |
| truncated | Yes | True when the configured row or finding cap was reached and more data may exist. | |
| columnTypes | No | Database type names for the result columns, in the same order as columns. | |
| pgStatStatements | No |