# Explain Plan (Multi-Stage)

{% hint style="info" %}
For the complete, up-to-date explain plan reference (including segment plans, logical plans, and workers plans), see [Explain Plan](/build-with-pinot/querying-and-sql/multi-stage-query/explain-plan-1.md) in the multi-stage query section.
{% endhint %}

Multi-stage explain plans are useful when a query uses features such as joins, subqueries, or distributed reshaping that do not exist in the single-stage path.

## What to look for

* logical plan shape
* exchange and distribution boundaries
* join and aggregation placement
* implementation details when you need to see the physical operator chain

If you only need to understand a simple filter or aggregation query, the single-stage explain plan page is usually enough.

## Useful patterns

When debugging multi-stage execution, start by:

1. running `EXPLAIN PLAN FOR`
2. checking whether the plan is logical or implementation-oriented
3. comparing the result with the query options you set

## What this page covered

This page covered what the multi-stage explain plan is useful for and how to approach it when debugging advanced SQL.

## Next step

If you are still deciding between engines, read [SSE vs MSE](/build-with-pinot/querying-and-sql/sse-vs-mse.md) in the broader query section.

## Related pages

* [Explain plan](/build-with-pinot/querying-and-sql/query-execution-controls/explain-plan.md)
* [Querying Pinot](/build-with-pinot/querying-and-sql/querying-pinot.md)
* [SQL syntax](/build-with-pinot/querying-and-sql/sql-syntax.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pinot.apache.org/build-with-pinot/querying-and-sql/query-execution-controls/explain-plan-multi-stage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
