> ## Documentation Index
> Fetch the complete documentation index at: /documents/llms.txt
> Use this file to discover all available pages before exploring further.

# SHOW RUNNING QUERIES

> SHOW RUNNING QUERIES 显示所有正在运行或在查询队列中等待执行的查询信息。

## 功能

显示所有正在运行或在查询队列中等待执行的查询的信息。此功能从 v3.1.4 开始支持。

**Tip**

查询队列必须进行配置，默认情况下处于关闭状态。有关更多信息，请参阅[查询队列文档](/documents/cn/4.2/administration/management/resource_management/query_queues.md)。

## 语法

```SQL theme={null}
SHOW RUNNING QUERIES
```

## 返回

* `QuerId`：该查询的 Query ID。
* `ResourceGroupId`：该查询命中的资源组 ID。当没有命中用户定义的资源组时，会显示为 “-”。
* `StartTime`：该查询开始时间。
* `PendingTimeout`：PENDING 状态下查询在队列中超时的时间。
* `QueryTimeout`：该查询超时的时间。
* `State`：该查询的排队状态。其中，PENDING 表示在队列中；RUNNING 表示正在执行。
* `Slots`：该查询申请的逻辑资源数量，目前固定为 `1`。
* `Frontend`：发起该查询的 FE 节点。
* `FeStartTime`：发起该查询的 FE 节点的启动时间。

## 示例

```Plain theme={null}
MySQL [(none)]> SHOW RUNNING QUERIES;
+--------------------------------------+-----------------+---------------------+---------------------+---------------------+-----------+-------+---------------------------------+---------------------+
| QueryId                              | ResourceGroupId | StartTime           | PendingTimeout      | QueryTimeout        |   State   | Slots | Frontend                        | FeStartTime         |
+--------------------------------------+-----------------+---------------------+---------------------+---------------------+-----------+-------+---------------------------------+---------------------+
| a46f68c6-3b49-11ee-8b43-00163e10863a | -               | 2023-08-15 16:56:37 | 2023-08-15 17:01:37 | 2023-08-15 17:01:37 |  RUNNING  | 1     | 127.00.00.01_9010_1692069711535 | 2023-08-15 16:37:03 |
| a6935989-3b49-11ee-935a-00163e13bca3 | 12003           | 2023-08-15 16:56:40 | 2023-08-15 17:01:40 | 2023-08-15 17:01:40 |  RUNNING  | 1     | 127.00.00.02_9010_1692069658426 | 2023-08-15 16:37:03 |
| a7b5e137-3b49-11ee-8b43-00163e10863a | 12003           | 2023-08-15 16:56:42 | 2023-08-15 17:01:42 | 2023-08-15 17:01:42 |  PENDING  | 1     | 127.00.00.03_9010_1692069711535 | 2023-08-15 16:37:03 |
+--------------------------------------+-----------------+---------------------+---------------------+---------------------+-----------+-------+---------------------------------+---------------------+
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.