Query Profile Action
GET /rest/v2/manager/query/sql/{query_id}
GET /rest/v2/manager/query/profile/text/{query_id}
GET /rest/v2/manager/query/profile/fragments/{query_id}
GET /rest/v2/manager/query/profile/graph/{query_id}
GET /rest/v2/manager/query/query_info
Gets information about select queries for all fe nodes in the cluster.
Query parameters
query_id
Optional, specifies the query ID of the query to be returned, default returns information for all queries.
search
Optional, specifies that query information containing strings is returned, currently only string matches are performed.
-
Optional, if true, returns query information for all fe nodes, if false, returns query information for the current fe node. The default is true.
Response
Examples
GET /rest/v2/manager/query/query_info
{
"msg": "success",
"code": 0,
"data": {
"Query ID",
"FE节点",
"查询用户",
"执行数据库",
"Sql",
"查询类型",
"开始时间",
"结束时间",
"执行时长",
"状态"
],
"rows": [
[
"127.0.0.1:8030",
"root",
"default_cluster:testdb",
"select c.id, c.name, p.age, p.phone, c.date, c.cost from cost c join people p on c.id = p.id where p.age > 20 order by c.id",
"Query",
"2021-07-29 16:59:12",
"2021-07-29 16:59:12",
"109ms",
"EOF"
]
]
},
"count": 0
}
GET /rest/v2/manager/query/sql/{query_id}
GET /rest/v2/manager/query/profile/text/{query_id}
Description
Get the sql and profile text for the specified query id.
Path parameters
query_id
The query id.
is_all_node
Optional, if true then query for the specified query id in all fe nodes, if false then query for the specified query id in the currently connected fe nodes. The default is true.
Response
{
"msg": "success",
"data": {
"profile": ""
},
"count": 0
}
Examples
get sql.
GET /rest/v2/manager/query/profile/fragments/{query_id}
Description
Path parameters
query_id
The query id.
Query parameters
-
Optional, if true then query for the specified query id in all fe nodes, if false then query for the specified query id in the currently connected fe nodes. The default is true.
{
"msg": "success",
"code": 0,
"data": [
{
"fragment_id": "",
"time": "",
"instance_id": {
"": ""
}
}
],
"count": 0
}
Examples
GET /rest/v2/manager/query/profile/graph/{query_id}
Description
Get the tree profile information of the specified query id, same as show query profile
command.
Path parameters
query_id
The query id.
Query parameters
fragment_id
andinstance_id
Optional, both parameters must be specified or not.
If both are not specified, a simple tree of profiles is returned, equivalent toshow query profile '/query_id'
;
If both are specified, a detailed profile tree is returned, which is equivalent toshow query profile '/query_id/fragment_id/instance_id'
.-
Optional, if true then query information about the specified query id in all fe nodes, if false then query information about the specified query id in the currently connected fe nodes. The default is true.
Response
{
"msg": "success",
"code": 0,
"data": {
"graph":""
},