---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/explain.md
cuppy_section: docs
cuppy_doc: FGEM-XSTY
cuppy_doc_uuid: 481719cf-9b25-43a9-8609-0d03081ed67f
cuppy_permalink: https://cuppy.io/salesforce/d/FGEM-XSTY
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/explain
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: cefda95a00eb59e75914830825473401ebbddf3ec217c2709fcc761ce833d232
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/explain.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

## EXPLAIN

**Applies to:** ❌ Data 360 SQL ✅ Tableau Hyper API

Show the query plan for a query.

where the available `<option>`s are

**Unstable Interface:** The returned query plans map directly to Hyper’s internal representation of query plans. As Hyper evolves, the query plans might change considerably. Don’t expect query plans (neither their formatting nor their semantics) to be stable across Hyper versions.

The `EXPLAIN` command retrieves information about the query plan which Hyper uses to execute the given query. The query plan describes which tables are accessed in which order, how they are joined together, which expressions are evaluated and all other details of query execution.

`EXPLAIN` can provide the following types of information:

*   The _optimized plan_. By default, if no other behavior is requested through an `<option>`, `EXPLAIN` will display the optimized plan.
*   The _optimizer steps_. If the `OPTIMIZERSTEPS` option is present, Hyper will output the plan at multiple intermediate steps during query optimization, e.g., before and after join reordering.
*   The _analyzed plan_. When invoked with the `ANALYZE` option, Hyper will actually execute the query, including all side effects (inserted/deleted tuples, etc.). Instead of the normal query results, you will however receive the query plan of the query, annotated with runtime statistics such as the number of tuples processed by each operator.
*   The _result schema_. With the `FORMAT SCHEMA`, only the list of result columns and their types are returned. The actual query plan is not printed.

The `FORMAT` option determines the formatting of the returned data. The available options are:

*   `TEXT_TREE`: a tree-like representation of the query plan as ASCII art. To be viewed using a monospaced font.
*   `JSON`: output the plan as pretty-printed JSON.
*   `TERSE_JSON`: output the plan as JSON without pretty-printing.
*   `SCHEMA`: only print a list of the returned columns. Don’t actually print information about the joins, table scans, etc.

By default, plans are formatted as ASCII art trees. The ASCII art representation is useful for quickly grasping the overall query structure, but is lacking details, such as the exact join conditions. Those details are present in the JSON output format, which can be requested using the `FORMAT JSON` option. To visualize a JSON query plan and interactively explore it, copy-paste the plan into [Hyper’s Plan Viewer](https://tableau.github.io/query-graphs/).

The following will give us the query plan of TPC-H query 6, formatted as ASCII art.

If we want to understand how the query plan changed during the optimization steps, we can use `OPTIMIZERSTEPS`:

If we want to view the plan in a graphical plan viewer, or want to see additional details in the plan, we can use the `FORMAT JSON` option and then copy-paste the resulting JSON into [Hyper’s Plan Viewer](https://tableau.github.io/query-graphs/).


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
