ACTIVE_QUERIES
active_queries
Name
active_queries
警告
自 2.1.1 起,此表函数移到 information_schema.active_queries 表。
description
表函数,生成active_queries临时表,可以查看当前doris集群中正在运行的 query 信息。
该函数用于from子句中。
syntax
active_queries()
active_queries()表结构:
mysql [(none)]>desc function active_queries();
+------------------+--------+------+-------+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+------------------+--------+------+-------+---------+-------+
| QueryId | TEXT | No | false | NULL | NONE |
| StartTime | TEXT | No | false | NULL | NONE |
| QueryTimeMs | BIGINT | No | false | NULL | NONE |
| WorkloadGroupId | BIGINT | No | false | NULL | NONE |
| Database | TEXT | No | false | NULL | NONE |
| FrontendInstance | TEXT | No | false | NULL | NONE |
| Sql | TEXT | No | false | NULL | NONE |
+------------------+--------+------+-------+---------+-------+
7 rows in set (0.00 sec)
example
mysql [(none)]>select * from active_queries();
+-----------------------------------+---------------------+-------------+-----------------+----------+------------------+--------------------------------+
| QueryId | StartTime | QueryTimeMs | WorkloadGroupId | Database | FrontendInstance | Sql |
+-----------------------------------+---------------------+-------------+-----------------+----------+------------------+--------------------------------+
| a84bf9f3ea6348e1-ac542839f8f2af5d | 2024-03-04 17:33:09 | 9 | 10002 | | localhost | select * from active_queries() |
+-----------------------------------+---------------------+-------------+-----------------+----------+------------------+--------------------------------+
1 row in set (0.03 sec)
keywords
active_queries