ClickHouse Architect
<!-- ADR: 2025-12-09-clickhouse-architect-skill -->
Prescriptive schema design, compression selection, and performance optimization for ClickHouse (v24.4+). Covers both ClickHouse Cloud (SharedMergeTree) and self-hosted (ReplicatedMergeTree) deployments.
Self-Evolving Skill: This skill improves through use. If instructions are wrong, parameters drifted, or a workaround was needed — fix this file immediately, don't defer. Only update for real, reproducible issues.
When to Use This Skill
Use this skill when:
- Designing ClickHouse table schemas with ORDER BY key selection
- Selecting compression codecs for column types
- Configuring partition keys for data lifecycle management
- Adding performance accelerators (projections, indexes, dictionaries)
- Auditing and optimizing existing ClickHouse schemas
Core Methodology
Schema Design Workflow
Follow this sequence when designing or reviewing ClickHouse schemas:
- Define ORDER BY key (3-5 columns, lowest cardinality first)
- Select compression codecs per column type
- Configure PARTITION BY for data lifecycle management
- Add performance accelerators (projections, indexes)
- Validate with audit queries (see scripts/)
- Document with COMMENT statements — ClickHouse table and column COMMENTs are the single source of truth (SSoT) for what each column means, how it was computed, and what constraints apply. No external doc, skill, or wiki supersedes the COMMENT. See