/clickhouse-pack:clickhouse-cost-tuningfrom clickhouse-pack
Optimizes ClickHouse Cloud costs through compute scaling, storage tiering, compression tuning, and query efficiency. Use when analyzing billing or reducing spend.
Ships in clickhouse-pack. 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.
Reduce ClickHouse Cloud costs through storage optimization, compression tuning, TTL policies, compute scaling, and query efficiency improvements. This skill walks the bill from top driver to fix: identify what you actually pay for, then apply the codec, TTL, compute, and query changes that move the number.
Deep copy-paste queries for every step live in references/implementation.md; end-to-end scenarios live in references/examples.md.
ClickHouse Cloud bills on four axes — and the biggest one is usually compute, not storage, because ClickHouse compresses data 10-20x.
| Component | Pricing Model | Key Driver |
|---|---|---|
| Compute | Per-hour per replica | vCPU + memory tier |
| Storage | Per GB-month | Compressed data on disk |
| Network | Per GB egress | Query result sizes |
| Backups | Per GB stored | Backup retention |
Break storage down by table, then by column, to find bloated data. The starter query — full breakdowns in references/implementation.md:
SELECT database, table,
formatReadableSize(sum(bytes_on_disk)) AS compressed_size,
round(sum(data_uncompressed_bytes) / sum(bytes_on_disk), 1) AS compression_ratio
FROM system.parts WHERE active
GROUP BY database, table ORDER BY sum(bytes_on_disk) DESC;
A column with a low compression ratio (e.g. 2x on a text/JSON blob) is your lever.
Apply codecs matched to the data shape — ZSTD(3) for JSON/text, Delta, ZSTD
for sequential IDs, DoubleDelta, ZSTD for timestamps — then OPTIMIZE ... FINAL
to re-merge. Full codec cheat sheet and verification queries in
references/implementation.md.
Add TTL to delete or move cold data automatically, or drop whole partitions for an immediate one-time reclaim. See the tiered hot/cold/delete TTL pattern in references/implementation.md.
Enable auto-scaling and idle suspension in the Cloud Console, cap per-query cores
and memory (max_threads, max_memory_usage), and batch small writes with
async_insert. Exact settings in references/implementation.md.
Find the most-scanned queries in system.query_log, replace repeated full scans
with materialized views, and use PREWHERE to read fewer columns. Queries in
references/implementation.md.
Track per-query read bytes/rows and duration in your application so cost regressions surface early. TypeScript cost-tracking wrapper in references/implementation.md.
Applying this skill produces:
ALTER TABLE ... MODIFY COLUMN ... CODEC(...) statements for bloated columns.system.query_log with materialized-view or PREWHERE fixes.| Issue | Cause | Solution |
|---|---|---|
| Storage growing fast | No TTL, no drops | Add TTL or schedule partition drops |
| High compute bill | Full-scan queries | Add materialized views, fix ORDER BY |
| Egress charges | Large result sets | Add LIMIT, use aggregations |
| Idle compute cost | No auto-suspend | Enable idle timeout in Cloud console |
Three worked scenarios take a real symptom through diagnosis → fix → verification — see references/examples.md:
ZSTD(3) codec.count() dashboard query
with a materialized view and enable idle suspension.For broader design patterns — schema layout, ingestion pipelines, and replica
topology that keep costs low by construction — see the
clickhouse-reference-architecture skill in this pack.
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub jeremylongshore/tons-of-skills-marketplace --plugin clickhouse-pack24 skills in this plugin
/clickhouse-ci-integrationRun ClickHouse integration tests in CI with GitHub Actions and Docker
containers. Use when setting up automated testing against a real ClickHouse
instance, configuring CI pipelines, or implementing schema validation in CI.
Trigger with "clickhouse CI", "clickhouse GitHub Actions", "clickhouse
integration tests", "test clickhouse in CI", "clickhouse automated testing".
/clickhouse-common-errorsDiagnose and fix the top 15 ClickHouse errors — query failures, insert problems,
memory limits, and merge issues.
Use when a ClickHouse query or insert throws an exception, a server-side error
appears in logs, or a failed query needs root-cause analysis.
Trigger with "clickhouse error", "fix clickhouse", "clickhouse not working",
"debug clickhouse", "clickhouse exception", "clickhouse syntax error".
/clickhouse-core-workflow-aDesign ClickHouse schemas with MergeTree engines, ORDER BY keys, and
partitioning.
Use when creating new tables, choosing an engine, designing sort keys, or
modeling data for analytical workloads on ClickHouse or ClickHouse Cloud.
Trigger with "clickhouse schema design", "clickhouse table design",
"clickhouse ORDER BY", "clickhouse partitioning", "MergeTree table".
Other plugins' skills for the same job