SHOW QUERIES

    Note

    • SHOW QUERIES从本地缓存获取当前Session中查询的状态,几乎没有延迟。

    1. nebula> SHOW QUERIES;
    2. +------------------+-----------------+--------+----------------------+----------------------------+----------------+-----------+-----------------+
    3. | SessionID | ExecutionPlanID | User | Host | StartTime | DurationInUSec | Status | Query |
    4. | 1625463842921750 | 46 | "root" | ""192.168.x.x":9669" | 2021-07-05T05:44:19.502903 | 0 | "RUNNING" | "SHOW QUERIES;" |
    5. +------------------+-----------------+--------+----------------------+----------------------------+----------------+-----------+-----------------+
    6. +------------------+-----------------+---------+----------------------+----------------------------+----------------+-----------+---------------------------------------------------------+
    7. | SessionID | ExecutionPlanID | User | Host | StartTime | DurationInUSec | Status | Query |
    8. +------------------+-----------------+---------+----------------------+----------------------------+----------------+-----------+---------------------------------------------------------+
    9. | 1625456037718757 | 54 | "user1" | ""192.168.x.x":9669" | 2021-07-05T05:51:08.691318 | 1504502 | "RUNNING" | "MATCH p=(v:player)-[*1..4]-(v2) RETURN v2 AS Friends;" |
    10. # 返回耗时TOP 10的查询。
    11. nebula> SHOW ALL QUERIES | ORDER BY $-.DurationInUSec DESC | LIMIT 10;
    12. +------------------+-----------------+---------+----------------------+----------------------------+----------------+-----------+-------------------------------------------------------+
    13. | SessionID | ExecutionPlanID | User | Host | StartTime | DurationInUSec | Status | Query |
    14. | 1625471375320831 | 98 | "user2" | ""192.168.x.x":9669" | 2021-07-05T07:50:24.461779 | 2608176 | "RUNNING" | "MATCH (v:player)-[*1..4]-(v2) RETURN v2 AS Friends;" |
    15. | 1625456037718757 | 99 | "user1" | ""192.168.x.x":9669" | 2021-07-05T07:50:24.910616 | 2159333 | "RUNNING" | "MATCH (v:player)-[*1..4]-(v2) RETURN v2 AS Friends;" |

    参数说明如下。