rds.data.query-statsTop statements by time, calls or rows from pg_stat_statements; installed: false until the extension is on
Request syntax
GET /rds/api/instances/{id}/query-statsPath parameters
idRequiredstring
Constraints: 3-64 chars, /^(?!ewdoc-)[a-z0-9-]+$/
Query parameters
orderOptionalenum
What the statements are ranked by; total_time when omitted
One of:
total_time,mean_time,calls,rowsDefault:
"total_time"limitOptionalnumber
At most this many statements; 25 when omitted
Constraints: integer, 1-100
Default:
25
Response
200 with { installed: false }, or { installed: true, since, statements }: each with queryId, query, calls, totalMs, meanMs, rows, cacheHitRatio and user.
A JSON response is wrapped as { "success": true, "data": … }; the CLI prints the whole body with --json.
Fields of data
installedWhen presentfalse
pg_stat_statements is installed in the database (false here)sinceWhen presentstring, may be null
When the statistics were last reset; null: unknownstatementsWhen presentarray of object
The top statements in the order asked forstatements[].queryIdWhen presentstring, may be null
PostgreSQL query idstatements[].queryWhen presentstring
Normalised statement text, cut at 2,000 charactersstatements[].callsWhen presentnumber
Callsstatements[].totalMsWhen presentnumber
Time spent, msstatements[].meanMsWhen presentnumber
Time per call, msstatements[].rowsWhen presentnumber
Rows returned or affectedstatements[].cacheHitRatioWhen presentnumber, may be null
Share of blocks served from memory, 0 to 1; null: nothing readstatements[].userWhen presentstring, may be null
Role it ran as
Checked against the handlers: every route test validates their answers against this schema.
Errors
- 400The request does not pass the schema above. The body is { "error": …, "issues": […] }, one issue per field.
- 401No credentials, or an access key that is unknown, revoked or expired.
- 403The caller's policies do not allow rds:DescribeDBQueryStats on this resource. The body names the action and the resource, and the refusal is recorded in the audit log.
- 404The resource does not exist in your organization.
Examples
The required parameters only, with example values. Replace id and the other placeholders with your own.
dcloud rds data query-stats idcurl -X GET "https://console.platform-development.deutschecloud.app/rds/api/instances/id/query-stats" \
-H "Authorization: EWS-ACCESS-KEY $ACCESS_KEY"Generated from the API description, the same one the API checks requests against and the CLI is built from. MCP tool: dcloud_rds_data_query-stats.