Agent skill · data analytics · jeremylongshore
clickhouse-cost-tuning
Optimize ClickHouse Cloud costs — compute scaling, storage tiering, compression, and query efficiency for lower bills. Use when analyzing ClickHouse Cloud bills, reducing storage costs, or optimizing compute utilization. Trigger with "clickhouse cost", "clickhouse billing", "reduce clickhouse spend", "clickhouse pricing", "clickhouse expensive", "clickhouse storage cost".
Why this skill is useful
Provides specific SQL queries and optimization techniques for reducing ClickHouse Cloud costs that the AI wouldn't reliably generate on its own.
What it needs
Requires clickhouse account access. About 3k tokens when loaded. Last updated 2026-08-07. 2,604 stars on the source repository.
What this skill does
ClickHouse Cost Tuning Overview 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. Prerequisites ClickHouse Cloud account with billing access Understanding of current data volumes and query patterns Instructions Step 1: Understand what you pay for 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 Step 2: Find the top cost driver Break storage down by table, then by column, to find bloated data. The starter query — full breakdowns in references/implementation.md: A column with a low compression ratio (e.g. 2x on a text/JSON blob) is your lever. Step 3: Improve compression 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. Step 4: Expire and tier old data with TTL 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. Step 5: Cut compute cost Enable auto-scaling and idle suspension in the Cloud Console, cap per-query cores and memory (maxthreads, maxmemoryusage), and batch small writes with asyncinsert. …
How to use it
Reference it in AdaL, Claude Code, Cursor or any coding agent — nothing to install:
@skills jeremylongshore/clickhouse-cost-tuning