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

    1. GET /rest/v2/manager/query/query_info
    2. {
    3. "msg": "success",
    4. "code": 0,
    5. "data": {
    6. "Query ID",
    7. "FE节点",
    8. "查询用户",
    9. "执行数据库",
    10. "Sql",
    11. "查询类型",
    12. "开始时间",
    13. "结束时间",
    14. "执行时长",
    15. "状态"
    16. ],
    17. "rows": [
    18. [
    19. "127.0.0.1:8030",
    20. "root",
    21. "default_cluster:testdb",
    22. "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",
    23. "Query",
    24. "2021-07-29 16:59:12",
    25. "2021-07-29 16:59:12",
    26. "109ms",
    27. "EOF"
    28. ]
    29. ]
    30. },
    31. "count": 0
    32. }

    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

    1. {
    2. "msg": "success",
    3. "data": {
    4. "profile": ""
    5. },
    6. "count": 0
    7. }

    Examples

    1. 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.

    1. {
    2. "msg": "success",
    3. "code": 0,
    4. "data": [
    5. {
    6. "fragment_id": "",
    7. "time": "",
    8. "instance_id": {
    9. "": ""
    10. }
    11. }
    12. ],
    13. "count": 0
    14. }

    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 and instance_id

      Optional, both parameters must be specified or not.
      If both are not specified, a simple tree of profiles is returned, equivalent to show query profile '/query_id';
      If both are specified, a detailed profile tree is returned, which is equivalent to show 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

    1. {
    2. "msg": "success",
    3. "code": 0,
    4. "data": {
    5. "graph":""
    6. },