clickhouse-analytics
Skill2 starsChanged 28 days agoApache-2.0View on GitHub
Architects, models, and optimizes high-throughput ClickHouse OLAP analytical schemas, MergeTree table engines, real-time materialized views, and vector similarity search.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- Ghost7802/awesome-agent-skillstheir own version, first seen Oct 17, 2026
- SkillMedev/data-engineering-pipelinetheir own version, first seen Oct 5, 2026
- ashish7802/awesome-agent-skillstheir own version, first seen Sep 13, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- Ghost7802/awesome-agent-skills★ 2same name
- ashish7802/awesome-agent-skills★ 1same name
- SkillMedev/data-engineering-pipeline★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository108 other files it gives its agents.
- AGENTS.mdAGENTS.md
- everything-gemini-maintainerSkill
- adversarial-fuzz-generatorSkill
- agent-evalsSkill
- ai-first-engineeringSkill
- alloydb-omni-vectorSkill
- apache-kafka-streamsSkill
- api-craftsmanSkill
- architecture-designerSkill
- argon-3d-game-engineSkill
- argon-3d-scene-architectSkill
- argon-procedural-asset-generatorSkill
- argon-visual-critique-loopSkill
- argo-workflowsSkill
- autonomous-incident-healerSkill
- axum-web-serviceSkill
- bigquery-vector-searchSkill
- browser-qa-testerSkill
- chromadb-vector-storeSkill
- cilium-ebpf-networkingSkill
- cloud-deploy-canarySkill
- cloudflare-r2-object-storageSkill
- cloudflare-workersSkill
- cloud-run-agentsSkill
- context-cachingSkill
- context-distillation-compressorSkill
- context-warmerSkill
- continuous-learningSkill
- cost-oracle-finopsSkill
- cross-repo-swarm-syncSkill
- cve-remediation-orchestratorSkill
- database-architectSkill
- dataproc-spark-analyticsSkill
- dbt-transformationSkill
- debezium-cdcSkill
- devops-pipelineSkill
- distributed-rate-limitingSkill
- docker-compose-orchestratorSkill
- duckdb-local-olapSkill
- dynamic-thinking-allocationSkill
- ebpf-microvm-sandboxSkill
- ebpf-sandbox-enforcerSkill
- elephant-goldfish-modelSkill
- envoy-ai-gatewaySkill
- ephemeral-swarm-orchestratorSkill
- fastapi-productionSkill
- fullstack-nextjsSkill
- game-audio-synthesizerSkill
- game-studioSkill
- gemini-function-callingSkill
- gemini-groundingSkill
- gemini-live-audio-transcriberSkill
- gemini-live-multimodalSkill
- gemini-live-screen-visionSkill
- gemini-multimodalSkill
- genetic-prompt-cross-pollinatorSkill
- git-craftsmanSkill
- github-opsSkill
- google-axSkill
- google-flow-orchestratorSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
1 rule. 0 are common, 0 are distinctive, and 1 is very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
0
Distinctive
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 104
Use uniqCombined64(user_id) or uniqHLL12(user_id) instead of uniqExact() when calculating HyperLogLog DAU/MAU across hundreds of millions …
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ClickHouse Analytics & Real-Time OLAP
This skill guides high-throughput schema modeling, query optimization, and real-time streaming ingestion on ClickHouse for analytics and vector retrieval.
⚡ Core Engine & Table Design
1. Engine Selection Matrix
| Engine | Best For | Behavior |
MergeTree | Default append-only timeseries | Base engine for fast parallel range scans and primary indexing. |
ReplacingMergeTree | Deduplication & upserts | Replaces rows with matching sorting keys during background compaction. |
SummingMergeTree | Real-time counter rollups | Automatically aggregates numeric columns with identical sorting keys. |
AggregatingMergeTree | Pre-aggregated state metrics | Stores intermediate aggregate states (e.g. uniqExactState, quantilesState). |
2. Primary Key & Partitioning Strategy
In ClickHouse, the ORDER BY defines the sparse primary index (1 index mark every 8,192 rows). Order columns by ascending cardinality:
CREATE TABLE analytics.events (
tenant_id UUID,
event_type LowCardinality(String),
user_id String,
properties JSON,
timestamp DateTime64(3, 'UTC')
) ENGINE = MergeTree()
PARTITION BY toYYYYMM(timestamp)
ORDER BY (tenant_id, event_type, timestamp, user_id)
SETTINGS index_granularity = 8192, ttl_only_drop_parts = 1;Rules:
- Never partition by high-cardinality fields (like
user_idortoDate(timestamp)); keep partition counts under 1,000 to prevent metadata explosion.- Use
LowCardinality(String)for strings with < 10,000 distinct values (e.g., country codes, event names) for dictionary encoding.
🔄 Real-Time Ingestion with Kafka & Materialized Views
Stream data continuously from Apache Kafka directly into optimized storage tables using pipe tables and materialized views:
-- 1. Kafka Queue Engine
CREATE TABLE analytics.kafka_events_queue (
raw_payload String
) ENGINE = Kafka
SETTINGS kafka_broker_list = 'kafka:9092',
kafka_topic_list = 'app-events',
kafka_group_name = 'clickhouse-consumer',
kafka_format = 'JSONAsString';
-- 2. Destination Storage Table
CREATE TABLE analytics.events_store (
event_id UUID,
event_name LowCardinality(String),
payload JSON,
created_at DateTime DEFAULT now()
) ENGINE = MergeTree()
ORDER BY (event_name, created_at);
-- 3. Materialized View Pipe
CREATE MATERIALIZED VIEW analytics.mv_kafka_to_events TO analytics.events_store AS
SELECT
JSONExtract(raw_payload, 'id', 'UUID') AS event_id,
JSONExtract(raw_payload, 'type', 'LowCardinality(String)') AS event_name,
raw_payload AS payload,
now() AS created_at
FROM analytics.kafka_events_queue;🚀 High-Performance Query Optimization
1. Leverage PREWHERE for Selective Filters
PREWHERE reads filtered columns first and only fetches remaining requested columns for matching rows:
SELECT
user_id,
count() AS total_events,
quantile(0.95)(JSONExtractFloat(properties, 'latency_ms')) AS p95_latency
FROM analytics.events
PREWHERE tenant_id = 'a3bb189e-8bf9-4888-9912-abcdef012345'
AND timestamp >= now() - INTERVAL 24 HOUR
WHERE event_type = 'api_request'
GROUP BY user_id
ORDER BY total_events DESC
LIMIT 50;2. Approximate Aggregations for Massive Scale
- Use
uniqCombined64(user_id)oruniqHLL12(user_id)instead ofuniqExact()when calculating HyperLogLog DAU/MAU across hundreds of millions of events (~10x faster, <1% error).
🧠 Vector Similarity Search in ClickHouse
ClickHouse natively computes high-dimensional vector distances:
CREATE TABLE analytics.article_embeddings (
id UUID,
title String,
embedding Array(Float32),
INDEX idx_emb embedding TYPE vector_similarity('hnsw', 'cosineDistance') GRANULARITY 1
) ENGINE = MergeTree()
ORDER BY id;
-- Retrieve Top-K Nearest Neighbors
SELECT
title,
cosineDistance(embedding, [0.021, -0.145, 0.891, ...]) AS score
FROM analytics.article_embeddings
ORDER BY score ASC
LIMIT 10;Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

