---
title: "DENIC Improves Query Times By 10x with ClickHouse"
description: "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."
url: "https://swe.quest/articles/denic-improves-query-times-by-10x-with-clickhouse-060ef54871f5e907"
canonical: "https://clickhouse.com/blog/denic-improves-query-times-by-10x-with-clickhouse"
source: "ClickHouse"
published: "2022-05-10"
difficulty: "medium"
kind: "Case study"
reading_minutes: 9
tags: ["analytics","query-engines","sql","performance","databases"]
---

# DENIC Improves Query Times By 10x with ClickHouse

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2022-05-10, 9 min read, Case study. Original: [https://clickhouse.com/blog/denic-improves-query-times-by-10x-with-clickhouse](https://clickhouse.com/blog/denic-improves-query-times-by-10x-with-clickhouse)

## Summary

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.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Query engines](https://swe.quest/tags/query-engines.md) (Data & databases)
- [SQL](https://swe.quest/tags/sql.md) (Languages)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Databases](https://swe.quest/tags/databases.md) (Data & databases)

## Prerequisites

- SQL ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- ClickHouse MergeTree engines ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- columnar databases ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))

## Keywords

ClickHouse, ReplacingMergeTree, AggregatingMergeTree, DENIC, Grafana, materialized views

## Related posts

- [Trade secrets: How Coinhall uses ClickHouse to power its blockchain data platform](https://swe.quest/articles/trade-secrets-how-coinhall-uses-clickhouse-to-power-its-blockchain-data-platform-a19f7fb99396fe78.md): ClickHouse · 2024-08-14 · Easy · 5 min read · Analytics & OLAP, Databases, Performance engineering, Cost optimization
  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.
- [Join me if you can: ClickHouse vs. Databricks vs. Snowflake - Part 2](https://swe.quest/articles/join-me-if-you-can-clickhouse-vs-databricks-vs-snowflake-part-2-66aede87450dc5eb.md): ClickHouse · 2025-06-25 · Medium · 8 min read · Analytics & OLAP, Performance engineering, Query engines, SQL
  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%.
- [Behind the music: How Chartmetric is scaling music analytics with ClickHouse](https://swe.quest/articles/behind-the-music-how-chartmetric-is-scaling-music-analytics-with-clickhouse-8636babde296e87c.md): ClickHouse · 2026-01-08 · Medium · 7 min read · Analytics & OLAP, Performance engineering, Databases, SQL
  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.
- [How HighLevel rebuilt its data platform for speed, scale, and simplicity on ClickHouse Cloud](https://swe.quest/articles/how-highlevel-rebuilt-its-data-platform-for-speed-scale-and-simplicity-on-826417013669e8fd.md): ClickHouse · 2026-01-12 · Medium · 8 min read · Analytics & OLAP, Databases, Scaling, Observability
  HighLevel replaced MySQL, Elasticsearch, Firestore and a document database with ClickHouse Cloud for lead activity, workflow logs, notifications and billing dashboards.
- [10x speed, 10x savings: Constant Contact’s journey from Pinot to ClickHouse](https://swe.quest/articles/10x-speed-10x-savings-constant-contact-s-journey-from-pinot-to-clickhouse-95f699b2a883c8b7.md): ClickHouse · 2025-11-04 · Medium · 5 min read · Analytics & OLAP, Databases, Performance engineering, Cost optimization, Storage engines
  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.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
