Skip to main content
The query detail API returns recent query execution details that are cached in FE memory. Note Query detail records are collected only when the FE configuration enable_collect_query_detail_info is set to true.

Endpoints

  • GET /api/query_detail (v1)
  • GET /api/v2/query_detail (v2, supports is_request_all_frontend and returns a wrapped result)

Parameters

Response

  • v1 returns a JSON array of QueryDetail objects. The array is streamed with chunked transfer encoding, so the response has no Content-Length header; for an HTTP/1.0 request, the body ends when the connection closes.
  • v2 returns { "code": "0", "message": "OK", "result": [ ... ] } where result is a QueryDetail list.

Authentication and authorization

This API requires HTTP Basic authentication. By default there is no additional privilege check beyond a successful login: any authenticated user can access the endpoint and can view all cached query details unless a user filter is applied. If the FE configuration item authorization_enable_query_profile_access_check is set to true, the profile field, and the explain field when it holds a plan rendered from that profile, are returned only for queries run by the current user, or for every query if the user has the SYSTEM-level OPERATE privilege. Other records are still listed, with those fields omitted.

QueryDetail fields

Examples

v1

v2