Skip to content

In development. Expect rough edges and changes. The source code is not public yet.

ClickHouse 9 min read Case study mediumAdept

DENIC Improves Query Times By 10x with ClickHouse

DENIC, the .de registry, built its data science platform on ClickHouse after rejecting Hadoop and Spark as too costly to administer and cloud services for privacy reasons. A denormalized ReplicatedMergeTree table stores more than 20 million per-domain time series, with holder data held in arrays. A daily query that finds the current state of domains whose holders changed took 5 minutes. Switching to a ReplicatedReplacingMergeTree table cut that to 3 minutes. An AggregatingMergeTree materialized view with argMax was dropped because it exhausted 128 GB of RAM. Rewriting the query to filter whole time series in the GLOBAL IN subquery, using LIMIT 1 BY instead of max(timestamp), and using ARRAY JOIN with IN instead of hasAny brought it to about 30 seconds, and that held at hundreds of millions of rows.

Related posts

  • Trade secrets: How Coinhall uses ClickHouse to power its blockchain data platform

    ClickHouse easyNovice

    Coinhall, an omnichain trading terminal aggregating swap data from 23 blockchains, moved from BigQuery (about 2-second queries, thousands of dollars per month) to QuestDB and then to self-hosted ClickHouse. In Coinhall's comparison against Rockset, SingleStore and Snowflake, ClickHouse ran candlestick queries in 20 ms, latest-price queries in 8 ms and ASOF JOINs in 50 ms, on a 4 vCPU / 16 GB server costing about $50 a month. After migrating, the team tuned queries around sparse primary indexes and replaced full-table LIMIT BY scans with aggregating tables fed by materialized views. They also avoided or simplified sort-merge joins.

  • Join me if you can: ClickHouse vs. Databricks vs. Snowflake - Part 2

    ClickHouse mediumAdept

    Replacing fact-to-dimension joins with in-memory dictionaries in ClickHouse Cloud sped up a 17-query join benchmark over 1.4 billion rows by 1.9–3.5× in total runtime, up to 6.6× on individual queries, and cut cost by up to 60%. The Locations table becomes a complex_key_hashed dictionary for String-key lookups. The Products table becomes a range_hashed dictionary that resolves time-versioned rows with a hash map plus binary search over date ranges, provided the source has no overlapping ranges per key. Queries change only by swapping JOINs for dictGet calls, and the gains grew as the cluster scaled from 2 to 8 nodes.

  • Behind the music: How Chartmetric is scaling music analytics with ClickHouse

    ClickHouse mediumAdept

    Chartmetric moved time-series and playlist workloads from Postgres and Snowflake to ClickHouse Cloud, cutting RDS storage from 28 TB to 18 TB and bringing queries that timed out at 60 seconds down to under 3 seconds. Projections, one sorted by recent modification and one by ISRC, fixed hourly sync jobs that had been timing out on tables ordered for API access. Replacing large JOINs with WHERE + IN filters and LIMIT/OFFSET batching cut one query from a 30 GB out-of-memory failure to 98 ms and 300 MB. The playlist cache, built on VersionedCollapsingMergeTree, now holds 5.5B rows in 340 GB, refreshes every five minutes, and answers top-artist queries in about 1.5 seconds versus 20 in Snowflake.

  • How HighLevel rebuilt its data platform for speed, scale, and simplicity on ClickHouse Cloud

    ClickHouse mediumAdept

    HighLevel replaced MySQL, Elasticsearch, Firestore and a document database with ClickHouse Cloud for lead activity, workflow logs, notifications and billing dashboards. Results: an 11 TB MySQL table compressed to 1.3 TB, P99 latency fell from over 6 s to under 200 ms, and a 60 TB Elasticsearch log store shrank to 6.27 TB served by three replicas. Notifications were modeled as MergeTree raw events plus ReplacingMergeTree read/delete state, with argMax instead of FINAL, Bloom filters and two-month partitions. Dashboards moved from daily cron reprocessing to SummingMergeTree materialized views. Key lessons are to model data as immutable, iterate on schemas, use bulk inserts, and instrument the client with per-service query observability.

  • 10x speed, 10x savings: Constant Contact’s journey from Pinot to ClickHouse

    ClickHouse mediumAdept

    Constant Contact replaced Apache Pinot with ClickHouse for real-time marketing analytics after Pinot's upsert handling without compaction grew to ~180 GB of daily segments, forced memory increases, and made restores take weeks. Historical data was bulk-loaded in three hours via Athena CTAS to S3 and the s3 table function, ReplacingMergeTree replaced Pinot upserts, and a single ClickHouse node delivered sub-second queries that took Pinot four servers and three brokers up to 6-7 seconds. Data compacted from 180 GB to 35 GB and infrastructure cost fell roughly 10x. The speedup is attributed to pread over mmap, LSM-style merges, C++ memory footprint, and fewer components, with lessons on schema types, primary key choice, and tested backups.

The quest for software engineering knowledge.

Look:
Layout: