---
title: "How ClickStack makes ClickHouse faster for observability"
description: "ClickStack speeds up ClickHouse for observability by generating and rewriting queries to fit how the engine stores, prunes and processes data, instead of passing raw SQL through."
url: "https://swe.quest/articles/how-clickstack-makes-clickhouse-faster-for-observability-323b8d19e17244d4"
canonical: "https://clickhouse.com/blog/clickstack-faster-observability"
source: "ClickHouse"
published: "2026-03-18"
difficulty: "medium"
kind: "Deep dive"
reading_minutes: 21
tags: ["observability","query-engines","analytics","performance","sql"]
---

# How ClickStack makes ClickHouse faster for observability

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-03-18, 21 min read, Deep dive. Original: [https://clickhouse.com/blog/clickstack-faster-observability](https://clickhouse.com/blog/clickstack-faster-observability)

## Summary

ClickStack speeds up ClickHouse for observability by generating and rewriting queries to fit how the engine stores, prunes and processes data, instead of passing raw SQL through. Search pages backwards through progressively wider time windows using optimize\_read\_in\_order, and charts split the time range into bucket-aligned chunks that run in parallel. Filters on map attributes are redirected to materialized columns, and full-text searches are rewritten to index-aware functions such as hasAllTokens, which cut one example from 0.7s to 0.03s. Queries are also routed automatically to incremental materialized views chosen by an EXPLAIN ESTIMATE cost model, giving roughly 30x faster dashboards with 28x less memory.

Written by swe.quest, not by the author.

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

## Topics

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

## Prerequisites

- ClickHouse MergeTree basics ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- SQL aggregation ([easy posts on SQL](https://swe.quest/tags/sql.md?difficulty=easy))
- OpenTelemetry logs and traces ([easy posts on Observability](https://swe.quest/tags/observability.md?difficulty=easy))

## Keywords

ClickStack, ClickHouse, OpenTelemetry, materialized views, AggregatingMergeTree, EXPLAIN ESTIMATE, data skipping indices, hasAllTokens

## Related posts

- [ClickStack: A (half) year in review](https://swe.quest/articles/clickstack-a-half-year-in-review-cf0d67e92c68a1b1.md): ClickHouse · 2026-01-06 · Easy · 12 min read · Observability, Analytics & OLAP, Performance engineering
  ClickStack, the ClickHouse-based observability stack built on HyperDX and OpenTelemetry, shipped a run of features between its May launch and December.
- [How we made ClickStack 5x faster for ClickHouse observability](https://swe.quest/articles/how-we-made-clickstack-5x-faster-for-clickhouse-observability-ed934241e77977aa.md): ClickHouse · 2026-07-02 · Hard · 22 min read · Observability, Analytics & OLAP, Performance engineering, Query engines, Storage engines
  ClickStack's OpenTelemetry logs schema, inherited from the ClickHouse exporter for the OTel Collector, was reworked through a benchmark-driven process.
- [What's new in ClickStack - April 2026](https://swe.quest/articles/what-s-new-in-clickstack-april-2026-8ecf13fb74019726.md): ClickHouse · 2026-05-19 · Medium · 13 min read · Observability, Analytics & OLAP, SQL, Performance engineering
  ClickStack's April 2026 release adds alerts driven by arbitrary ClickHouse SQL, so rolling baselines and standard-deviation anomaly checks can be written with window functions and fire when the query returns 1.
- [What's new in ClickStack. December '25.](https://swe.quest/articles/what-s-new-in-clickstack-december-25-c182e3421d3be356.md): ClickHouse · 2025-12-30 · Medium · 8 min read · Observability, Analytics & OLAP, Query engines, Performance engineering, SQL
  ClickStack's HyperDX UI can now use ClickHouse Incremental Materialized Views registered against a source to accelerate charts, searches, histograms and dashboards, even when filters are applied.
- [So, is ClickHouse winning the observability wars?](https://swe.quest/articles/so-is-clickhouse-winning-the-observability-wars-3577c2c26e782dd2.md): ClickHouse · 2026-08-27 · Medium · 20 min read · Observability, Analytics & OLAP, Storage engines, Search, Performance engineering
  ClickHouse has become a common storage and query layer for observability, and the main reason is its columnar architecture.

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)
