clickhouse-io

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

Updated Mar 26, 2026
One-click install
npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill clickhouse-io-erwinv2k-tkg
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: clickhouse-io
Source: https://github.com/erwinv2k-TKG/AgentesVSC/tree/main/packs/everything-claude-code/docs/zh-TW/skills/clickhouse-io
Command: npx skills add https://github.com/erwinv2k-TKG/AgentesVSC --skill clickhouse-io-erwinv2k-tkg

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Designing efficient ClickHouse schemas and writing performant analytical queries requires deep knowledge of columnar storage, MergeTree engines, and aggregation functions that most developers lack, leading to slow queries and poorly structured tables. ## Core Features & Use Cases - Table Design Patterns: Provides templates for MergeTree, ReplacingMergeTree, and AggregatingMergeTree engines with proper partitioning and ordering keys. - Query Optimization: Demonstrates efficient filtering, aggregation with quantile functions, window functions, and materialized views for real-time rollups. - Data Pipeline Patterns: Covers bulk inserts, streaming ingestion, ETL workflows, and change data capture from PostgreSQL. - Use Case: A data engineer building a market analytics platform can use these patterns to create hourly aggregated statistics tables, run retention and funnel analyses, and monitor slow queries via system.query_log. ## Quick Start Ask the AI to design a ClickHouse table with proper partitioning and write an optimized aggregation query for your time-series analytics data.

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 for analytics workloads?

Use the MergeTree engine with PARTITION BY on a date expression like toYYYYMM(date) and ORDER BY your most-filtered columns. Place high-cardinality indexed fields first in the sort key and choose the smallest appropriate data types for compression.

How to optimize slow ClickHouse queries?

Filter on indexed columns first, avoid SELECT *, and use ClickHouse-specific functions like quantile() instead of percentile calculations. Check system.query_log for queries exceeding duration thresholds and review read_rows and memory_usage metrics.

What is the difference between MergeTree and ReplacingMergeTree?

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 analytics data.

How do I insert data into ClickHouse efficiently?

Use batch inserts that combine many rows into a single INSERT statement rather than individual row inserts in a loop. For continuous ingestion, use streaming inserts through the ClickHouse client library to pipeline data batches.

When should I use materialized views in ClickHouse?

Use materialized views with AggregatingMergeTree when you need real-time pre-aggregated metrics like hourly statistics. They maintain aggregate states automatically as raw data arrives, and you query them with merge functions like sumMerge and uniqMerge.