---
title: "ClickHouse LowCardinality: When It Helps and When It Hurts"
url: https://daily.dev/posts/clickhouse-lowcardinality-when-it-helps-and-when-it-hurts-8spfk4osb
source_url: https://last9.io/blog/clickhouse-lowcardinality
type: article
source: "Last9"
published: 2026-06-15T22:00:37.761Z
updated: 2026-06-15T22:01:01.452Z
tags: ["observability", "clickhouse"]
reading_time: 11
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# ClickHouse LowCardinality: When It Helps and When It Hurts

**[Last9](https://daily.dev/sources/last9)** · 11 min read · 0 upvotes · 0 comments

## Summary

ClickHouse's LowCardinality type applies dictionary encoding to columns, replacing repeated string values with compact integer indices. It delivers significant storage and query performance gains on columns with fewer than ~10,000 distinct values (e.g., log level, service name, region, HTTP method). However, it actively hurts performance on high-cardinality columns like trace IDs, span IDs, user IDs, and raw log messages, where the dictionary grows as large as the data itself, adding overhead with no compression benefit. Production data from Last9 shows LowCardinality columns like ServiceName and SeverityText achieving ~372-376x compression, while plain String columns like TraceId achieve only ~25x. A key nuance: pod_id looks low-cardinality at any instant but accumulates high cardinality over time as pods are recreated. The guidance is to measure column cardinality with uniqExact() before deciding, and to apply LowCardinality column-by-column rather than as a blanket optimization.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://last9.io/blog/clickhouse-lowcardinality>

## Similar posts on daily.dev

- [Optimizing Your ClickHouse Schema for Storage Efficiency](https://daily.dev/posts/optimizing-your-clickhouse-schema-for-storage-efficiency-pjuw80x9a) · BigData Boutique blog · 3 upvotes · 0 comments
- [High Cardinality in ClickHouse at Scale: What Actually Breaks](https://daily.dev/posts/high-cardinality-in-clickhouse-at-scale-what-actually-breaks-pc6axtguq) · Last9 · 0 upvotes · 0 comments

---

Tags: [#observability](https://daily.dev/tags/observability), [#clickhouse](https://daily.dev/tags/clickhouse)

[View this post on daily.dev](https://daily.dev/posts/clickhouse-lowcardinality-when-it-helps-and-when-it-hurts-8spfk4osb)
