> ## 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 runs a SQL statement and returns its query profile with per-operator execution statistics.

EXPLAIN ANALYZE executes the specified SQL statement, and shows the query profile of this statement. For more information about query profile, see [Query Profile Overview](/documents/4.2/best_practices/query_tuning/query_profile_overview.md).

This feature is supported from v3.1 onwards.

> **CAUTION**
>
> Only users with the SELECT or INSERT privilege on a specific table can perform this operation.

## Syntax

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

## Parameters

`statement`: the SQL statement of which to show the query profile. Both [SELECT](/documents/4.2/sql-reference/sql-statements/table_bucket_part_index/SELECT/SELECT.md) and [INSERT INTO](/documents/4.2/sql-reference/sql-statements/loading_unloading/INSERT.md) are supported.

## Usage notes

Please note that when you analyze the profiles of an INSERT INTO statement, no data will actually be inserted. By default, the transaction is aborted, ensuring that no unintended changes are made to the data in the process of profile analysis.

## Examples

Example 1: Simulate and analyze a SELECT statement. The query result are discarded.

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

Example 2: Simulate and analyze an INSERT INTO statement. The loading transaction will be aborted.

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

## Relevant SQLs

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


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