with one click
clickhouse-best-practices
// Production operational practices: insert batching, async writes, query cache, connection pooling, and recommended settings.
// Production operational practices: insert batching, async writes, query cache, connection pooling, and recommended settings.
Exact column names for the system tables the agent queries most (processes, query_log, parts, merges, mutations, replicas, replication_queue, disks, settings, zookeeper, users/grants, metrics) plus rules for choosing dedicated tools over raw SQL. Load before hand-writing SQL against system tables.
Cluster management: distributed tables, ON CLUSTER DDL, node lifecycle, resharding, load balancing, and Keeper migration.
Schema migrations: ALTER patterns, engine changes, zero-downtime swaps, clickhouse-local offline migrations, and lightweight UPDATE/DELETE strategies.
ReplicatedMergeTree operations, failover procedures, lag diagnosis, quorum writes, and Keeper management.
RBAC configuration, row policies, quotas, network security, audit logging, and access control best practices.
Compression codecs, TTL policies, tiered storage, part management, and disk space optimization.
| name | clickhouse-best-practices |
| description | Production operational practices: insert batching, async writes, query cache, connection pooling, and recommended settings. |
min_insert_block_size_rows / max_insert_block_size_rowsSET async_insert = 1; SET wait_for_async_insert = 1; (1=durable, 0=fire-and-forget)async_insert_max_data_size (1M) and async_insert_busy_timeout_ms (10s) for batch windowSET allow_experimental_query_cache = 1; SET use_query_cache = 1;query_cache_ttl; share across users: query_cache_shared_between_users = 1enable_writes_to_query_cache, enable_reads_from_query_cachepool_size, max_queries; keep-alive is criticalmax_connectionssystem.metrics for HTTPConnection/TCPConnection to size poolsmax_threads — lower for concurrent loads; max_insert_threads — raise for parallel insertsmax_execution_time / max_memory_usage — per-query limitsjoin_algorithm — prefer grace_hash or auto for large joinsinput_format_allow_errors_num / ratio — tolerate parse errors in bulk importsCOLUMNS('pattern') — regex column selection; APPLY func transforms matchesclusterAllReplicas('cluster') — aggregate across all replicasFINAL — force merge for ReplacingMergeTree; use sparingly (full scan)