Explain a statement's plan
Plans a statement from streamEngineStatements without running it: EXPLAIN (GENERIC_PLAN) in a read-only transaction on Postgres 16 and later, EXPLAIN FORMAT=JSON on the digest's sample text on MySQL. Flags a sequential scan with a filter on a table of 10,000 rows or more and suggests an index built from the plan's columns.
Authorization
cloady Personal API token (cldy_…)
In: header
Path Parameters
Query Parameters
Value in
- "production"
- "preview"
- "development"
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/workspaces/string/apps/string/services/string/engine/plan" \ -H "Content-Type: application/json" \ -d '{ "statement": "string" }'{ "lines": [ { "depth": 0, "text": "string", "detail": "string", "flagged": true } ], "relations": [ "string" ], "hint": { "title": "string", "detail": "string", "sql": "string" }, "note": "string"}Read a database's slow statements GET
Returns statements slower than the engine's own threshold across `range`, newest first: Postgres `duration:` log lines, MongoDB slow operation log lines, ClickHouse system.query_log, the performance_schema statement history on MySQL and MariaDB, and SLOWLOG (COMMANDLOG on Valkey) on a cache. The last two keep only recent entries. Needs the developer role, because statements and command arguments carry data.
Turn on a database's statement statistics and slow log POST
Turns on what streamEngineStats lists as off. Postgres: adds pg_stat_statements to shared_preload_libraries and restarts the service, then creates the extension in the `postgres` database on a second call, and logs statements slower than 250 ms with lock waits, through ALTER SYSTEM. MySQL and MariaDB: the statement history consumer and deadlock printing at runtime, and on MariaDB user statistics. Never resets any counter.