ch_explain_query
Analyze your ClickHouse query's execution plan to reveal partition pruning and sorting key usage, and receive targeted optimization suggestions for better performance.
Instructions
Analyze a query's execution plan and suggest optimizations.
Runs EXPLAIN PLAN and EXPLAIN PIPELINE, then provides structured analysis:
Whether partition pruning is active
Whether sorting keys are utilized
Specific optimization suggestions (add time filters, use pre-aggregated tables, etc.)
This is the key differentiator from generic ClickHouse tools — it doesn't just execute queries, it advises on how to write better ones.
Args: sql: The SELECT query to analyze database: Target database (default: cdc_pipeline)
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| sql | Yes | ||
| database | No | cdc_pipeline |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |