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

# EXPLAIN ANALYZE

> EXPLAIN ANALYZE executes a SQL statement and returns its query profile with per-operator execution statistics.

## 功能

执行指定 SQL，并显示相应的 Query Profile 文件。更多信息，参考 [Query Profile 概述](/documents/cn/4.2/best_practices/query_tuning/query_profile_overview.md)。

此功能自 v3.1 起支持。

> **注意**
>
> 该操作需要有指定表的 SELECT 或 INSERT 权限。

## 语法

```SQL theme={null}
EXPLAIN ANALYZE <statement>
```

## 参数说明

`statement`：需要查询 Query Profile 的 SQL 语句。支持 [SELECT](/documents/cn/4.2/sql-reference/sql-statements/table_bucket_part_index/SELECT/SELECT.md) 和 [INSERT INTO](/documents/cn/4.2/sql-reference/sql-statements/loading_unloading/INSERT.md)。

## 使用说明

请注意，当您模拟并分析 INSERT INTO 语句的 Query Profile 时，实际上不会导入任何数据。默认情况下，导入事务会被强制回滚，以确保在分析过程中不会对数据进行意外更改。

## 示例

示例一：模拟分析 SELECT 语句，查询返回结果会被丢弃。

![img](https://mintcdn.com/mirrorship-docs/8gpPdHU-sBXASb5i/documents/images/21470ec4cbba27aa2cf7e234.jpeg?fit=max\&auto=format\&n=8gpPdHU-sBXASb5i\&q=85\&s=784372117fe330929120c5e975dabd0b)

示例二：模拟分析 INSERT INTO 语句。执行结束后，导入事务会被强制回滚，数据不会被实际导入。

![img](https://mintcdn.com/mirrorship-docs/8FakUMFrFjmoxRt5/documents/images/f3c043585981e615458a27ba.jpeg?fit=max\&auto=format\&n=8FakUMFrFjmoxRt5\&q=85\&s=db93f7a7aad7116330cf1c57ece71df2)

## 相关 SQL

* [SHOW PROFILELIST](/documents/cn/4.2/sql-reference/sql-statements/cluster-management/plan_profile/SHOW_PROFILELIST.md)
* [ANALYZE PROFILE](/documents/cn/4.2/sql-reference/sql-statements/cluster-management/plan_profile/EXPLAIN_ANALYZE.md)


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