kusto_show_queryplan
Analyze Kusto query performance without execution. Get the logical operator tree, estimated rows, and execution hints to understand cost and data scanning before running expensive queries.
Instructions
Retrieves the query execution plan without actually running the query.
This is significantly lighter than execution and useful for understanding
performance characteristics and estimating query impact.
:param query: The KQL query to get the execution plan for.
:param cluster_uri: The URI of the Kusto cluster.
:param database: Optional database name. If not provided, uses the default database.
:param client_request_properties: Optional dictionary of additional client request properties.
:return: A compact dictionary with the following keys:
* query_text — the query as received by the engine
* stats — planning statistics: Duration, PlanSize (bytes), RelopSize (bytes)
* relop_tree — the logical operator tree (compact JSON)
* execution_hints — extracted from the physical plan:
* estimated_rows — total row count the engine expects to process
* concurrency — parallelism hint (-1 = auto, 1 = parallel partitions)
* spread — node spread hint (-1 = auto, 1 = distributed)
* shard_scans — per-shard info: total_rows and has_selection (filter applied)
* error — if the query has semantic errors (e.g., bad column name), this contains
the error message. The query is NOT executed.
Critical:
* This does NOT execute the query — it only generates the plan.
* The plan shows the logical operators the engine would use.
* Use this to estimate cost and understand performance before running expensive queries.
* PlanSize indicates the overall plan complexity; RelopSize indicates the logical tree size.
* execution_hints.estimated_rows and shard_scans reveal the data volume the engine expects to scan.
* has_selection=true in shard_scans means a filter narrows the scan (extent pruning applies).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| query | Yes | ||
| cluster_uri | Yes | ||
| database | No | ||
| client_request_properties | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||