Query Runs
View the history of executed queries. Each query run records the SQL text, execution time, result reference, and status. Useful for auditing and debugging query performance.
List query runs
GET
/v1/query-runsList query runs for the database named by the required X-Database-Id header.
Query parameters
limitinteger— Maximum number of resultscursorstring— Pagination cursorstatusstring— Filter by status (comma-separated, e.g. status=running,failed)saved_query_idstring— Filter by saved query ID
Headers
X-Database-Idstring— required. Database to scope the query runs to (required)
Response 200 — List of query runs
countinteger— required. Min:0has_moreboolean— requiredlimitinteger— required. Min:0next_cursorstring,nullquery_runsQueryRunInfo[] — requiredbytes_scannedinteger,null— Total bytes of table data read from storage to run this query.nullwhen the query touches no table at all (for example a constant expression likeSELECT 1). May be0when the query reads a table but not its row data — for example a row count served from table statistics.completed_atstring,nullcreated_atstring— requirederror_messagestring,nullexecution_time_msinteger,nullidstring— requiredresult_idstring,nullrow_countinteger,nullrows_scannedinteger,null— Total rows read from storage to run this query, before any filtering or aggregation. Distinct fromrow_count, which is how many rows the query returned.nullwhen the query reads no table data from storage.saved_query_idstring,nullsaved_query_versioninteger,nullserver_processing_msinteger,null— Total server-side processing time for this query (milliseconds). Measured from query start to result ready. Includes SQL execution, task spawning, and result preparation. Does not include network transit. Populated for all completed query runs (sync and async).snapshot_idstring— requiredsql_hashstring— requiredsql_textstring— requiredstatusstring— requiredtrace_idstring,nulluser_public_idstring,null— Who ran this query: the account id from the access token the request was made with. Use it to group a caller's query history. Requests made with a credential that identifies no account instead record an opaqueuser_-prefixed identifier, which is stable for that credential but cannot be resolved to an account.warning_messagestring,null
{
"count": 0,
"has_more": true,
"limit": 0,
"next_cursor": "string",
"query_runs": [
{
"bytes_scanned": 0,
"completed_at": "2026-01-01T00:00:00Z",
"created_at": "2026-01-01T00:00:00Z",
"error_message": "string",
"execution_time_ms": 0,
"id": "string",
"result_id": "string",
"row_count": 0,
"rows_scanned": 0,
"saved_query_id": "string",
"saved_query_version": 0,
"server_processing_ms": 0,
"snapshot_id": "string",
"sql_hash": "string",
"sql_text": "string",
"status": "string",
"trace_id": "string",
"user_public_id": "string",
"warning_message": "string"
}
]
}
Errors
| Status | Description |
|---|---|
400 | Missing or malformed X-Database-Id header |
404 | Database not found |
Get query run
GET
/v1/query-runs/{id}Get the status and details of a specific query run by ID, scoped to the database named by the required X-Database-Id header.
Path parameters
idstring— required. Query run ID
Headers
X-Database-Idstring— required. Database the query run belongs to (required)
Response 200 — Query run details
bytes_scannedinteger,null— Total bytes of table data read from storage to run this query.nullwhen the query touches no table at all (for example a constant expression likeSELECT 1). May be0when the query reads a table but not its row data — for example a row count served from table statistics.completed_atstring,nullcreated_atstring— requirederror_messagestring,nullexecution_time_msinteger,nullidstring— requiredresult_idstring,nullrow_countinteger,nullrows_scannedinteger,null— Total rows read from storage to run this query, before any filtering or aggregation. Distinct fromrow_count, which is how many rows the query returned.nullwhen the query reads no table data from storage.saved_query_idstring,nullsaved_query_versioninteger,nullserver_processing_msinteger,null— Total server-side processing time for this query (milliseconds). Measured from query start to result ready. Includes SQL execution, task spawning, and result preparation. Does not include network transit. Populated for all completed query runs (sync and async).snapshot_idstring— requiredsql_hashstring— requiredsql_textstring— requiredstatusstring— requiredtrace_idstring,nulluser_public_idstring,null— Who ran this query: the account id from the access token the request was made with. Use it to group a caller's query history. Requests made with a credential that identifies no account instead record an opaqueuser_-prefixed identifier, which is stable for that credential but cannot be resolved to an account.warning_messagestring,null
{
"bytes_scanned": 0,
"completed_at": "2026-01-01T00:00:00Z",
"created_at": "2026-01-01T00:00:00Z",
"error_message": "string",
"execution_time_ms": 0,
"id": "string",
"result_id": "string",
"row_count": 0,
"rows_scanned": 0,
"saved_query_id": "string",
"saved_query_version": 0,
"server_processing_ms": 0,
"snapshot_id": "string",
"sql_hash": "string",
"sql_text": "string",
"status": "string",
"trace_id": "string",
"user_public_id": "string",
"warning_message": "string"
}
Errors
| Status | Description |
|---|---|
400 | Missing or malformed X-Database-Id header |
404 | Query run or database not found |