active_queries

Name

SinceVersion dev

active_queries

description

Table-Value-Function, generate a temporary table named active_queries. This tvf is used to view the information of running queries in doris cluster.

This function is used in FROM clauses.

syntax

active_queries()

active_queries() table schema:

1. mysql [(none)]> desc function active_queries();
2. +------------------------+--------+------+-------+---------+-------+
3. | Field                  | Type   | Null | Key   | Default | Extra |
4. +------------------------+--------+------+-------+---------+-------+
5. | BeHost                 | TEXT   | No   | false | NULL    | NONE  |
6. | BePort                 | BIGINT | No   | false | NULL    | NONE  |
7. | QueryId                | TEXT   | No   | false | NULL    | NONE  |
8. | StartTime              | TEXT   | No   | false | NULL    | NONE  |
9. | QueryTimeMs            | BIGINT | No   | false | NULL    | NONE  |
10. | WorkloadGroupId        | BIGINT | No   | false | NULL    | NONE  |
11. | QueryCpuTimeMs         | BIGINT | No   | false | NULL    | NONE  |
12. | ScanRows               | BIGINT | No   | false | NULL    | NONE  |
13. | ScanBytes              | BIGINT | No   | false | NULL    | NONE  |
14. | BePeakMemoryBytes      | BIGINT | No   | false | NULL    | NONE  |
15. | CurrentUsedMemoryBytes | BIGINT | No   | false | NULL    | NONE  |
16. | Database               | TEXT   | No   | false | NULL    | NONE  |
17. | FrontendInstance       | TEXT   | No   | false | NULL    | NONE  |
18. | Sql                    | TEXT   | No   | false | NULL    | NONE  |
19. +------------------------+--------+------+-------+---------+-------+
20. 14 rows in set (0.00 sec)

example

1. mysql [(none)]>select * from active_queries();
2. +------------+--------+----------------------------------+---------------------+-------------+-----------------+----------------+----------+------------+-------------------+------------------------+----------+------------------+-------+
3. | BeHost     | BePort | QueryId                          | StartTime           | QueryTimeMs | WorkloadGroupId | QueryCpuTimeMs | ScanRows | ScanBytes  | BePeakMemoryBytes | CurrentUsedMemoryBytes | Database | FrontendInstance | Sql   |
4. +------------+--------+----------------------------------+---------------------+-------------+-----------------+----------------+----------+------------+-------------------+------------------------+----------+------------------+-------+
5. | 127.0.0.1 |   6090 | 71fd11b7b0e438c-bc98434b97b8cb98 | 2024-01-16 16:21:15 |        7260 |           10002 |           8392 | 16082249 | 4941889536 |         360470040 |              360420915 | hits     | localhost   | SELECT xxxx |
6. +------------+--------+----------------------------------+---------------------+-------------+-----------------+----------------+----------+------------+-------------------+------------------------+----------+------------------+-------+
7. 1 row in set (0.01 sec)

keywords

1. active_queries