# EXPLAIN (/docs/reference/sql/statements/explain)



EXPLAIN [#explain]

The Query API accepts a statement that starts with `EXPLAIN`. The server parses
the rest of the statement as an explain query.

Syntax [#syntax]

```sql
EXPLAIN <query>
```

Use the `indexes` option to inspect index pruning for a table query.

```sql
EXPLAIN indexes = 1
SELECT <columns> FROM <table> WHERE <condition>
```

Examples [#examples]

Explain a scalar query.

```sql test
EXPLAIN SELECT 1
```

Related [#related]

* [Optimize queries](/docs/guides/query/optimize-queries)
* [SELECT](/docs/reference/sql/statements/select)
