- Home
- Skills
- Affaan M
- Everything Claude Code
- Clickhouse Io
clickhouse-io_skill
- JavaScript
46.5k
GitHub Stars
1
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill affaan-m/everything-claude-code --skill clickhouse-io- SKILL.md10.2 KB
Overview
This skill provides ClickHouse database patterns, query optimization techniques, and data engineering best practices for high-performance analytical workloads. It focuses on table design, ingestion patterns, materialized views, monitoring, and common analytics queries to get predictable, low-latency OLAP results. The guidance is practical and targeted at engineers building real-time dashboards, ETL/CDC pipelines, and large-scale analytics.
How this skill works
It inspects schema choices (MergeTree variants, partitioning, ORDER BY), query patterns (filters, aggregations, window functions), and ingestion strategies (bulk, streaming, CDC). It recommends concrete SQL patterns, table engines, and TypeScript snippets for efficient bulk inserts and streaming. It also highlights monitoring queries and performance checks to identify slow queries and large table parts.
When to use it
- Designing ClickHouse schemas or choosing MergeTree engine variants
- Optimizing slow analytical queries or reducing scan/read volume
- Building high-throughput ingestion pipelines (batch or streaming)
- Implementing real-time aggregations and dashboards with materialized views
- Migrating analytics workloads from row databases like Postgres/MySQL
- Setting up monitoring for query performance and table health
Best practices
- Partition by time (month/day) and avoid excessive small partitions
- Order by frequently filtered, high-cardinality columns first to improve pruning
- Use smallest appropriate numeric types, LowCardinality for repeated strings, and Enum for categories
- Batch inserts rather than single-row inserts; use streaming for continuous ingestion
- Use AggregatingMergeTree or materialized views for pre-aggregation and real-time metrics
- Monitor system.query_log and system.parts for slow queries, read_bytes, and table sizes
Example use cases
- Hourly materialized view generating aggregated metrics for dashboards
- ETL job extracting from Postgres, transforming, and bulk inserting to ClickHouse hourly
- CDC listener that streams Postgres notifications into ClickHouse for near real-time analytics
- Time-series dashboards using toStartOfHour/day with quantile() for latency percentiles
- Retention, funnel, and cohort queries using ClickHouse aggregation and window functions
FAQ
Use ReplacingMergeTree when incoming data can contain duplicates and you want ClickHouse to keep the latest row per key. Use MergeTree for standard append-only analytics where deduplication is not needed.
How do I reduce query latency for large tables?
Partition by time, pick an ORDER BY that matches common filters, use projections/materialized views for heavy aggregations, and ensure queries filter on indexed columns first to enable partition and index pruning.