Skills DirectorySkills Directory
SkillsLearnSecurityCategoriesDocsBlogPro
Sign InSubmit Skill
Skills Directory

Security-tested agent skills for Claude, coding agents, and AI workflows.

Directory

  • Browse Skills
  • All Skills A–Z
  • Claude Skills
  • Claude Code Skills
  • Agent Skills
  • Categories
  • Authors
  • Submit a Skill

Learn

  • Learn Hub
  • Install Claude Skills
  • Write SKILL.md
  • Skills vs MCP
  • Directories Compared

Security

  • Security
  • Methodology
  • Secure Claude Skills
  • Security Badges
  • Chrome Extension
  • Skill Manager

Company

  • About
  • Community
  • Blog
  • API Docs
  • Advertise

2026 Skills Directory. All rights reserved.

ProTermsPrivacyRefunds
Back to skills

Clickhouse Pro

ASecurity

ClickHouse columnar analytics — schema design, MergeTree tuning, and fast queries — use for OLAP and high-volume event data.

2 stars
0 votes
0 copies
0 views
Added 9/29/2026
ai-agentsgodatabase

Works with

cli

Security Analysis

A100/100

Scanned 9/29/2026

$npx -y skills add aicodedecode/awesome-muse-skills --skill clickhouse-pro --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Clickhouse Pro?

Add the live security badge to your README — it updates automatically with every re-scan.

Security grade badge for Clickhouse Pro
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/aicodedecode-clickhouse-pro/badge)](https://www.skillsdirectory.com/skills/aicodedecode-clickhouse-pro)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
Files
SKILL.md
---
name: clickhouse-pro
description: ClickHouse columnar analytics — schema design, MergeTree tuning, and fast queries — use for OLAP and high-volume event data.
category: database
---

## Overview

ClickHouse is a columnar OLAP database built for sub-second analytics over
billions of rows. Its speed comes from a storage layout (MergeTree family) and
query engine designed for scans and aggregations — which means schema and query
patterns differ sharply from row-oriented databases. This skill covers designing
for ClickHouse's strengths.

## When to use

- Designing tables (`MergeTree`, `ReplacingMergeTree`, `AggregatingMergeTree`)
- Choosing `ORDER BY` / partition keys for time-series or event data
- Writing aggregation queries (`GROUP BY`, `uniq`, `quantiles`, window functions)
- Tuning inserts (batches vs trickle), mutations, and background merges
- Operating clusters: replication, sharding, backups

## Core concepts

**ORDER BY is the primary index.** The `ORDER BY` key (sorting key) determines
data layout on disk and which queries skip granules. Put the most-filtered
columns first — typically `(tenant_id, event_time, ...)` — because ClickHouse
prunes using this key. Choose wrong and every query scans everything.

**Columnar means wide tables are cheap.** Unlike row stores, selecting 5 columns
from a 200-column table reads only those 5. Denormalize aggressively — joins
are supported but the engine rewards flat, pre-joined event tables.

**Inserts: batch, don't trickle.** Each insert creates a part; thousands of
tiny inserts create thousands of parts and merge storms. Batch to ~1k–100k rows
per insert (or use async inserts / a buffer table). Aim for parts in the
hundreds, not millions.

**Engines encode update semantics.** `ReplacingMergeTree` keeps the latest row
per key (deduplication at merge time — queries should still use `FINAL` or
`argMax` for exactness). `AggregatingMergeTree` stores partial aggregate states
for incremental rollups. `SummingMergeTree`/`CollapsingMergeTree` handle
specific accounting patterns. Pick the engine that matches how data changes.

**Approximation is a feature.** `uniq()`, `quantiles()`, and sampling (`TABLESAMPLE`,
`SAMPLE BY`) trade tiny accuracy losses for 10–100x speedups — perfect for
dashboards over billions of rows.

## Practical workflow

1. **Start from the queries:** list the filters and group-bys your dashboards
   need; these dictate the `ORDER BY` key and partitioning (usually by month on
   the timestamp).
2. **Define the table** with the right engine, `PARTITION BY toYYYYMM(ts)`,
   `ORDER BY (tenant_id, ts)`, and low-cardinality types (`LowCardinality(String)`,
   `DateTime`, appropriate integer widths) to cut storage.
3. **Load with batches:** buffer upstream, insert in chunks, monitor
   `system.parts` count per table — sustained growth signals an insert problem.
4. **Write queries that prune:** filter on the sorting key prefix, avoid
   `SELECT *`, use `PREWHERE` for highly selective filters on non-key columns,
   and prefer approximate functions for exploratory work.
5. **Handle mutations carefully:** `ALTER UPDATE/DELETE` are heavyweight
   background operations — fine occasionally, not a workload pattern. Design
   around append-mostly data.
6. **Operate:** replicate with `ReplicatedMergeTree` + ZooKeeper/ClickHouse
   Keeper, shard by a hash key for scale-out, back up with filesystem snapshots
   or `BACKUP TABLE`, and monitor merge/mutation queues.

## Common pitfalls

- **Row-by-row inserts** — the #1 ClickHouse anti-pattern; causes part
  explosion, merge backlog, and degraded queries. Batch always.
- **High-cardinality first in ORDER BY** (e.g. a UUID) — destroys compression
  and pruning; order by commonly filtered low/medium-cardinality columns first.
- **Using `FINAL` on huge tables routinely** — forces full merges at query
  time; use it sparingly or design deduplication into the pipeline.
- **Treating it like Postgres** — frequent small updates, heavy joins, and
  transactional expectations fight the architecture. ClickHouse is append-mostly
  analytics.
- **Ignoring data types:** `String` for everything wastes 5–10x storage vs
  `LowCardinality(String)` and right-sized numerics; storage is query speed in
  a columnar engine.
- **No TTL / retention policy** on ever-growing event tables — disk fills,
  merges slow, queries degrade. Set `TTL` or drop old partitions on a schedule.

Attribution

aicodedecodeaicodedecode
View sourceSee grades on GitHubMore from aicodedecode →
SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments (0)

No comments yet. Be the first to comment!

SSkills DirectorySkills Directory

Ship a skill? Prove it's safe.

Free 120-pattern security scan, letter grade, and an embeddable README badge.

Submit a skill

Related Skills

Caveman

Terse caveman voice: answer first, fluff gone, every technical fact kept. Use for /caveman, "caveman mode", "talk like caveman", "be brief", "less tokens". Stays on until "stop caveman" or "normal mode".

1100021 votes

Hyperplan

Adversarial multi-agent planning skill. Self-orchestrates 5 hostile category members (unspecified-low, unspecified-high, deep, ultrabrain, artistry) via team-mode for ruthless cross-critique debate, distills only the defensible insights, then MANDATORILY hands the distilled insight bundle to the `plan` agent for executable plan formalization. Use when planning needs maximum rigor and surfacing of weak assumptions, blind spots, and over-engineering. Triggers: 'hyperplan', 'hpp', '/hyperplan', ...

698621 votes

Writing Skills

Create and manage Claude Code skills in HASH repository following Anthropic best practices. Use when creating new skills, modifying skill-rules.json, understanding trigger patterns, working with hooks, debugging skill activation, or implementing progressive disclosure. Covers skill structure, YAML frontmatter, trigger types (keywords, intent patterns), UserPromptSubmit hook, and the 500-line rule. Includes validation and debugging with SKILL_DEBUG. Examples include rust-error-stack, cargo-dep...

3931 votes

Mcp Code Execution

Routes multi-tool workflows through MCP servers for large datasets and pipelines. Use when Bash tool overhead is limiting throughput on data-heavy tasks.

3421 votes

catchup

Recovers the conversation and failed tool calls of a previous Codex, Amp, Claude Code, Antigravity, Cline, Copilot CLI, Cursor, DeepSeek Harness, Grok Build, Kimi, OpenCode, Pi Agent, or ZCode session. Use when the user says "catch up", "what did the last session do", "get me up to speed", "I switched agents", asks to recover/summarize a previous session before continuing, or asks to diagnose or report a catchup failure. Do NOT use for the current conversation, git history, or any non-agent log.

741 votes
View all in ai-agents →