/major-ai-skills:clickhousefrom major-ai-skills
Design ClickHouse MergeTree ORDER BY and partitions; batch inserts; use projections and skip indexes; tune mutations, replication lag, and backups without treating it as OLTP.
Ships in major-ai-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
ClickHouse is a columnar OLAP DBMS: data lives in parts merged in the background; ORDER BY (primary key order) enables sparse indexing—not a traditional PK uniqueness guarantee. PARTITION BY prunes scans; tiny inserts create too many parts (merge storms). Replication uses ZooKeeper/ClickHouse Keeper; Kafka engine tables buffer ingest.
Batch inserts / Kafka engine / S3 insert
-> MergeTree parts on disk
-> background merges
-> SELECT with partition + primary-key pruning
-> optional projections / materialized views
Use when
Do not use when
@postgresql)ORDER BY matches filter + group keys; partition by time (month/week), never high-cardinality IDs alone.parts_to_merge and Too many parts.EXPLAIN indexes = 1.ALTER UPDATE/DELETE are heavy—prefer append-only + ReplacingMergeTree/CollapsingMergeTree patterns; use FINAL sparingly.BACKUP/RESTORE (version-dependent) or freeze + object storage; restore to new tables/clusters first; verify parts on all replicas.CREATE TABLE events.page_views
(
event_date Date,
event_time DateTime,
user_id UInt64,
path LowCardinality(String),
duration_ms UInt32
)
ENGINE = ReplicatedMergeTree('/clickhouse/tables/{shard}/page_views', '{replica}')
PARTITION BY toYYYYMM(event_date)
ORDER BY (path, user_id, event_time)
TTL event_date + INTERVAL 180 DAY;
INSERT INTO events.page_views
SELECT * FROM input('event_date Date, event_time DateTime, user_id UInt64, path String, duration_ms UInt32')
FORMAT Parquet;
EXPLAIN indexes = 1
SELECT path, count() AS views, avg(duration_ms)
FROM events.page_views
WHERE event_date >= today() - 7 AND path = '/pricing'
GROUP BY path;
-- DO NOT: millions of single-row INSERTs from app loops
INSERT INTO events.page_views VALUES (...);
| Failure signature | Root cause | Diagnostic & fix |
|---|---|---|
Too many parts | Tiny inserts / bad partition key | Batch; async_insert; fix PARTITION BY |
| Full table scan | ORDER BY mismatch | Reorder keys; add projection |
| Memory limit exceeded | Huge GROUP BY cardinality | Preaggregate; approx_*; limit dimensions |
| Replication lag | Large parts / network | Check system.replicas; disk |
| Mutation stuck | Mass UPDATE | Redesign append-only; cancel mutation |
| Duplicate rows in ReplacingMergeTree | Expected without FINAL | Query with argMax pattern |
LowCardinality(String) for enums; sensible codecs (Delta, ZSTD).max_execution_time for ad-hoc SQL users.@snowflake features differ).@duckdb — local OLAP on files@kafka — ingest into Kafka engine tables@dbt — ClickHouse adapter modelsMANDATORY: Reject single-row insert loops for high-volume paths. Always pair ORDER BY and PARTITION BY with documented query patterns. Treat ReplacingMergeTree dedupe as merge-time, not transactional exactly-once.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub alivirgo/major-ai-skills --plugin major-ai-skills412 skills in this plugin
/3d-slicerAutomate 3D Slicer research workflows with MRML, VTK/ITK, DICOM data, and Segment Editor. Use for software workflows, not clinical interpretation./abbreviated-git-statusInspect Git branch, staging, and working-tree changes with short or porcelain status output when a compact repository check is needed./ableton-liveAutomate Ableton Live sessions with Python MIDI Remote Scripts, Max for Live, AbletonOSC, and Link synchronization./act-as-a-personal-tutorExplain a subject step by step, assess prior knowledge, and use short exercises to check understanding before advancing.Other plugins' skills for the same job