clickhouse
Skill4 starsChanged 54 days agoMITView on GitHub
Operate and evolve ClickHouse - disk/memory forensics, runaway trace_log/text_log cleanup and retention, codecs and LowCardinality, MergeTree ORDER BY/partition/TTL design, zero-downtime rebuilds with EXCHANGE TABLES, persistent config on Docker/Railway. Use when an instance is large or OOMing, or when designing or migrating a schema.
7 other projects use a version of this.
Adopted by
Most recently taken up by
- MMACABRE/SKILLStheir own version, first seen Nov 8, 2026
- speakeasy-api/gramtheir own version, first seen Nov 6, 2026
- base58ed/claude_code_filestheir own version, first seen Oct 20, 2026
- G1Joshi/Agent-Skillstheir own version, first seen Oct 13, 2026
- muxammadmamajonov/dot-claudetheir own version, first seen Jul 6, 2026
- cline/skillstheir own version, first seen Jun 18, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- speakeasy-api/gram★ 277same name
- cline/plugins★ 36same name
- cline/skills★ 35same name
- G1Joshi/Agent-Skills★ 15same name
- base58ed/claude_code_files★ 1same name
- MMACABRE/SKILLS★ 1same name
- muxammadmamajonov/dot-claude★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository18 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- agent-browserSkill
- ai-writing-detectorSkill
- animate-svgSkill
- browserbaseSkill
- commitSkill
- geist-designSkill
- generate-faviconSkill
- generate-imageSkill
- google-indexingSkill
- google-search-consoleSkill
- google-searchSkill
- humanizerSkill
- keyword-researchSkill
- parallelSkill
- remove-backgroundSkill
- reviewSkill
- web-uiSkill
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 1 is distinctive, and 0 are very specific to this project.
0
Common
Most of the 7 edited versions we read keep these.
1
Distinctive
This author's own choices. Worth a look.
0
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 56
All metadata — no data scan, safe on an OOMing box:
“Common” is measured: kept by at least 6 in 10 of the 7 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ClickHouse: operations, schema & migrations
Generic, battle-tested lessons for running and evolving ClickHouse — especially MergeTree analytics tables on small or managed (Railway/Fly/Docker) instances, where RAM is tight and you don't control the host config directly.
Connect however the project does. Two equivalent forms used throughout:
- HTTP (works anywhere, lets you pass per-query settings as URL params):
curl -s "https://HOST:PORT/?database=DB&SETTING=VAL" -H 'X-ClickHouse-User: U' -H 'X-ClickHouse-Key: P' --data-binary 'SELECT 1' - client:
clickhouse-client --host H --user U --password P -q 'SELECT 1'
Append FORMAT PrettyCompact (human) or FORMAT JSON/TSV (parsing) to SELECTs.
When to use
- An instance's disk is unexpectedly large / a volume is filling up.
- Queries fail with
MEMORY_LIMIT_EXCEEDED/ OvercommitTracker. - Designing or optimizing a MergeTree table (compression, sort key, partition, TTL).
- Changing
ORDER BY, dropping a column, or any table migration. - Configuring system-log retention (trace_log / text_log / metric_log / …).
- Running ClickHouse on Docker or a managed host and config won't stick.
Golden rules (the ones that bite hardest)
- "The DB is 500 GB" is usually not your data. ClickHouse's own system logs
(
trace_log,text_log,asynchronous_metric_log,part_log, …) ship with weak/zero retention and grow unbounded; they routinely dwarf real tables. Measure per-database/table before assuming. →server-ops.md - On a small box, aggregations OOM.
count()/GROUP BY/uniqExact()over tens of millions of rows blow the memory ceiling. Usemax_threads=1,uniq()(HLL) notuniqExact(), filter on the sort-key prefix, or read metadata (system.parts) instead of scanning. →server-ops.md - No codecs = default LZ4 = leaving 2–5× on the table.
timestamp→Delta+ZSTD; monotonic ints →T64/Gorilla+ZSTD; text →ZSTD; low-cardinality strings →LowCardinality. →schema-design.md - Never put a random/high-entropy column (UUID) in
ORDER BY. It's incompressible and a unique tiebreaker buys nothing on plain MergeTree (it doesn't dedup). →schema-design.md - You cannot shrink/reorder a sort key in place (
MODIFY ORDER BYonly appends). Changing it = full table rebuild. →migrations.md - Materialized views bind to their source by NAME →
EXCHANGE TABLESswaps the table under them and they keep firing and keep their rollups. This makes zero-downtime rebuilds possible. →migrations.md - On managed hosts only the data volume persists.
/etc/clickhouse-serveris ephemeral; config written there (or viassh) vanishes on redeploy. Bake it into a thin image. →deployment.md
First move when "ClickHouse is too big": measure, don't assume
All metadata — no data scan, safe on an OOMing box:
-- size per database (system vs your data)
SELECT database, formatReadableSize(sum(data_compressed_bytes)) AS comp,
formatReadableSize(sum(data_uncompressed_bytes)) AS uncomp, sum(rows) AS rows
FROM system.parts WHERE active GROUP BY database ORDER BY sum(data_compressed_bytes) DESC;
-- top tables across all databases
SELECT database, table, formatReadableSize(sum(data_compressed_bytes)) AS comp, sum(rows) AS rows
FROM system.parts WHERE active GROUP BY database, table
ORDER BY sum(data_compressed_bytes) DESC LIMIT 20;
-- actual volume usage
SELECT name, formatReadableSize(total_space - free_space) AS used,
formatReadableSize(free_space) AS free FROM system.disks;
-- per-column for one table: where the bytes are + compression ratio
SELECT column, formatReadableSize(sum(column_data_compressed_bytes)) AS comp,
round(sum(column_data_uncompressed_bytes)/sum(column_data_compressed_bytes),1) AS ratio,
round(sum(column_data_compressed_bytes)/(SELECT sum(rows) FROM system.parts
WHERE active AND database='DB' AND table='T'),1) AS bytes_per_row
FROM system.parts_columns WHERE active AND database='DB' AND table='T'
GROUP BY column ORDER BY sum(column_data_compressed_bytes) DESC;ratio near 1.0 = incompressible (random data — wrong codec or a UUID);
combine with bytes_per_row + % of table to pick what to fix first.
Reference files
- server-ops.md — system-log bloat & retention, memory-limited query tuning,
the
max_table_size_to_dropguard, insert-vs-merge OOM, reclaiming space. - schema-design.md — codecs, LowCardinality, ORDER BY / primary key, partitioning, TTL, type choices, what not to store.
- migrations.md — ALTER limits, the zero-downtime rebuild recipe (create → STOP MERGES → chunked backfill → watermark → EXCHANGE → tail-copy), materialized-view behavior, partial-insert recovery.
- deployment.md — config persistence on Docker/managed platforms, config.d vs
users.d, disabling a system log, XML-defined users, the
railway sshfootgun.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

