storage-optimization
Installation
SKILL.md
Storage Optimization
When to use this skill
Load when users ask about disk usage, compression, TTL, or storage tiers.
Compression Codecs
- Default: LZ4 — fast, moderate compression
ZSTD(level)— better compression, slower. Level 1-22 (3 is good default)Delta+ ZSTD — excellent for time-series monotonic dataDoubleDelta— best for timestamps and countersGorilla— optimized for floating-point gauge metricsT64— for integer columns with small range- Per-column:
ALTER TABLE t MODIFY COLUMN col TYPE UInt32 CODEC(Delta, ZSTD(3))
TTL Policies
- Table-level:
ALTER TABLE t MODIFY TTL event_time + INTERVAL 90 DAY - Column-level:
ALTER TABLE t MODIFY COLUMN old_col TTL event_time + INTERVAL 30 DAY - Move to volume:
TTL event_time + INTERVAL 7 DAY TO VOLUME 'cold' - Delete:
TTL event_time + INTERVAL 365 DAY DELETE
Related skills
More from duyet/clickhouse-monitoring
troubleshooting
Diagnose and resolve common ClickHouse issues: OOM, slow merges, replication lag, disk full, stuck mutations, and query failures.
2replication-guide
ReplicatedMergeTree operations, failover procedures, lag diagnosis, quorum writes, and Keeper management.
2query-optimization
Query optimization strategies: PREWHERE, JOIN patterns, materialized views, EXPLAIN analysis, index usage, and query profiling.
2security-hardening
RBAC configuration, row policies, quotas, network security, audit logging, and access control best practices.
2migration-patterns
Schema migrations, ALTER patterns, engine changes, data backfill, and zero-downtime migration strategies.
2cluster-operations
Distributed table management, resharding, node addition/removal, and cluster topology operations.
2