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

# Explain

> EXPLAIN, EXPLAIN ANALYZE and EXPLAIN VERBOSE: reading and measuring a plan from SQL.

**Applies to:** Embedded ❌, Enterprise ✅

```sql SQL icon="database" theme={"theme":{"light":"vitesse-light","dark":"catppuccin-mocha"}}
EXPLAIN SELECT * FROM documents WHERE identifier < 1000
EXPLAIN ANALYZE SELECT * FROM documents WHERE identifier < 1000
```

| Statement | What it returns |
| - | - |
| `EXPLAIN <query>` | Logical and physical plan, without executing the query. |
| `EXPLAIN ANALYZE <query>` | Executes the query and annotates each operator with runtime metrics (rows, timing). |
| `EXPLAIN VERBOSE <query>` | Adds intermediate optimizer plans on top of `EXPLAIN`. |

The result is a small relation with `plan_type` and `plan` columns, read
through the same client you use for regular queries. See
[Connecting](https://docs.lancedb.com/sql.md#connecting).

SQL plans and the SDK's
[`explain_plan` and `analyze_plan`](https://docs.lancedb.com/basics/sql#query-plans) output share scan and index
operators. Use the same approach to inspect index coverage and filter pushdown;
SQL can also add joins, aggregates and other operators:

> [card] [What it shows](https://docs.lancedb.com/basics/sql.md#inspect-a-query-plan)
>
> Reading a plan: operators, pushdown, index usage.

> [card] [What it measures](https://docs.lancedb.com/basics/sql.md#analyze-a-query-plan)
>
> Reading the metrics, and a worked before/after.

## What to look for

| Sign | Means |
| - | - |
| `ScalarIndexQuery` | the predicate used a scalar index |
| `LanceScan` with high `bytes_read` | inspect the selected columns, filter pushdown and index use |
| `FilterExec` above a search | the filter ran after search rather than pushing into it |
| `ANNSubIndex` / `ANNIvfPartition` | the vector index was used |

A `LanceScan` feeding a join is the common one worth acting on. See
[Joins](https://docs.lancedb.com/sql/dql/join.md#performance).

For a table's columns and types without a plan, see
[`DESCRIBE`](https://docs.lancedb.com/sql/ddl/table#describe).


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