clickhouse-io

Implements ClickHouse table schemas, query optimization, and analytics patterns for OLAP workloads.

1|Updated Oct 11, 2025
One-click install
npx skills add https://github.com/ibytechaos/claude --skill clickhouse-io-ibytechaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clickhouse-io
Source: https://github.com/ibytechaos/claude/tree/main/plugins/everything-claude-code/skills/clickhouse-io
Command: npx skills add https://github.com/ibytechaos/claude --skill clickhouse-io-ibytechaos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing efficient ClickHouse schemas and writing performant analytical queries requires deep knowledge of MergeTree engines, partitioning, and aggregation functions that most developers lack when migrating from row-oriented databases like PostgreSQL or MySQL. ## Core Features & Use Cases - Table Design Patterns: Provides templates for MergeTree, ReplacingMergeTree, and AggregatingMergeTree engines with correct partitioning and ordering keys. - Query Optimization: Covers efficient filtering, ClickHouse-specific aggregation functions like quantile and uniq, window functions, and materialized views for real-time rollups. - Data Engineering Pipelines: Includes bulk insert, streaming insert, ETL, and change data capture patterns from PostgreSQL to ClickHouse. - Use Case: When migrating analytics from PostgreSQL to ClickHouse, use this Skill to design a partitioned MergeTree table, build a materialized view for hourly stats, and write batch inserts that avoid the performance pitfalls of row-by-row ingestion. ## Quick Start Ask the AI to design a ClickHouse table schema and optimized aggregation query for your time-series analytics workload.

Frequently Asked Questions about clickhouse-io

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

FAQPage Schema
How do I design a ClickHouse table schema for analytics?

Use the MergeTree engine with a time-based partition key such as toYYYYMM(date) and an ORDER BY clause placing frequently filtered columns first. Choose the smallest appropriate data types and LowCardinality for repeated strings to improve compression and query speed.

How to optimize slow ClickHouse aggregation queries?

Filter on indexed columns first, use ClickHouse-specific functions like quantile and uniq instead of generic equivalents, and pre-aggregate with AggregatingMergeTree or materialized views. Check system.query_log to identify queries exceeding duration thresholds.

What is the difference between MergeTree and ReplacingMergeTree in ClickHouse?

ReplacingMergeTree deduplicates rows with the same sorting key during background merges, making it suitable for data arriving from multiple sources. Standard MergeTree keeps all inserted rows and is the default choice for append-only analytical data.

Can I migrate analytics from PostgreSQL to ClickHouse?

Yes, use an ETL pattern that extracts rows from PostgreSQL, transforms them into the target schema, and batch inserts into ClickHouse. For ongoing sync, listen to PostgreSQL notifications and forward changes as change data capture events.

Why are individual row inserts slow in ClickHouse?

ClickHouse is optimized for bulk writes, and each small insert creates a separate data part that triggers expensive background merges. Batch rows into a single INSERT statement or use streaming inserts for continuous ingestion.

When should I avoid using ClickHouse?

Avoid ClickHouse for transactional workloads requiring frequent single-row updates or deletes, since it is designed for OLAP rather than OLTP. Also avoid SELECT *, the FINAL modifier, and heavy JOIN usage, which degrade analytical performance.