query-analyzer

Analyze ClickHouse queries using EXPLAIN and system.query_log for optimization.

4|Updated Jan 24, 2026
One-click install
npx skills add https://github.com/rahmatrdn/go-ch-manager --skill query-analyzer
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: query-analyzer
Source: https://github.com/rahmatrdn/go-ch-manager/tree/main/.claude/skills/query-analyzer
Command: npx skills add https://github.com/rahmatrdn/go-ch-manager --skill query-analyzer

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

ClickHouse query workloads often suffer from inefficiencies due to missing insights into schema, plans, and runtime metrics. This skill helps explain and diagnose performance issues and guide optimizations.

Core Features & Use Cases

  • Schema assessment: use SHOW CREATE TABLE and DESCRIBE TABLE to understand table structure and partitioning implications.
  • Query plan analysis: leverage EXPLAIN (indexes=1), EXPLAIN actions=1, and EXPLAIN PIPELINE to reveal how a query will be executed.
  • Runtime performance auditing: inspect system.query_log for read_rows vs result_rows, read_bytes, memory_usage, and query_duration_ms to pinpoint bottlenecks.
  • Use Case: Optimize a slow report by identifying heavy scans, bad joins, or missing partition pruning and implementing targeted changes.

Quick Start

Provide a sample ClickHouse query to analyze and receive a detailed optimization plan.

Frequently Asked Questions about query-analyzer

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I diagnose slow ClickHouse queries and identify performance bottlenecks?

To diagnose slow ClickHouse queries, this skill inspects system.query_log metrics like read_rows, memory_usage, and query_duration_ms to pinpoint runtime bottlenecks and heavy table scans. It then provides a targeted optimization plan.

How does ClickHouse EXPLAIN plan analysis help optimize query execution?

ClickHouse EXPLAIN plan analysis reveals execution paths using indexes and pipeline actions. This skill leverages EXPLAIN outputs to identify inefficient joins, missing partition pruning, and poor index usage to guide query optimization.

What do I need to access before analyzing ClickHouse query performance?

You need access to a running ClickHouse instance with permissions to execute SHOW CREATE TABLE, DESCRIBE TABLE, EXPLAIN, and system.query_log auditing to perform schema assessment and runtime performance analysis.

Can I use this to optimize ClickHouse report workloads suffering from bad joins?

Yes, you can optimize slow report workloads by identifying heavy scans, bad joins, and missing partition pruning. The skill assesses table structure and runtime metrics to recommend targeted schema and query changes.

What is the best way to check if missing partition pruning causes ClickHouse query inefficiencies?

The best way to check for missing partition pruning is by running SHOW CREATE TABLE and DESCRIBE TABLE to understand partitioning implications. This skill combines schema assessment with EXPLAIN plan analysis to detect inefficient scans.

Why does my ClickHouse query read millions of rows but return very few results?

Your ClickHouse query likely lacks proper partition pruning or uses inefficient filters. This skill audits system.query_log to compare read_rows against result_rows and read_bytes, identifying heavy full-table scans causing the inefficiency.