_CORE
AI & Agentic Systems Core Information Systems Cloud & Platform Engineering Data Platform & Integration Security & Compliance QA, Testing & Observability IoT, Automation & Robotics Mobile & Digital Banking & Finance Insurance Public Administration Defense & Security Healthcare Energy & Utilities Telco & Media Manufacturing Logistics & E-commerce Retail & Loyalty
References Technologies Blog Know-how Tools
About Collaboration Careers
CS EN
Let's talk

ClickHouse Analytics

08. 12. 2024 1 min read intermediate

Extremely fast for analytical queries.

Installation

docker run -d --name ch -p 8123:8123 -p 9000:9000 clickhouse/clickhouse-server

Table

CREATE TABLE events (
    event_date Date, 
    user_id UInt64, 
    event_type String
) ENGINE=MergeTree() 
PARTITION BY toYYYYMM(event_date) 
ORDER BY (event_type,event_date);

Queries

SELECT event_type, count(), uniq(user_id) 
FROM events 
WHERE event_date>='2024-01-01' 
GROUP BY event_type 
ORDER BY count() DESC;
  • 10-100x faster than PG for analytics
  • Columnar format
  • 10x compression
  • SQL compatible

ClickHouse for Analytics

OLTP=PostgreSQL, OLAP=ClickHouse.

clickhouseanalyticsolap
Share:

CORE SYSTEMS tým

Stavíme core systémy a AI agenty, které drží provoz. 15 let zkušeností s enterprise IT.