---
title: "Index sharding in ClickHouse Cloud: Petabyte-scale data needs petabyte-scale indexing"
description: "Index sharding in ClickHouse Cloud splits primary and secondary index analysis across replicas using consistent hashing over data parts."
url: "https://swe.quest/articles/index-sharding-in-clickhouse-cloud-petabyte-scale-data-needs-petabyte-scale-162dcf2c4093c588"
canonical: "https://clickhouse.com/blog/index-sharding-clickhouse-cloud-petabyte-scale-indexing"
source: "ClickHouse"
published: "2026-04-21"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 16
tags: ["query-engines","analytics","distributed-databases","memory-management","performance"]
---

# Index sharding in ClickHouse Cloud: Petabyte-scale data needs petabyte-scale indexing

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2026-04-21, 16 min read, Deep dive. Original: [https://clickhouse.com/blog/index-sharding-clickhouse-cloud-petabyte-scale-indexing](https://clickhouse.com/blog/index-sharding-clickhouse-cloud-petabyte-scale-indexing)

## Summary

Index sharding in ClickHouse Cloud splits primary and secondary index analysis across replicas using consistent hashing over data parts. Each replica loads and analyzes only its own slice of the index and returns matching granule ranges for the initiator to merge, so total index memory across the fleet stays at the size of the index instead of growing with replica count. If analysis of a part fails on a remote replica, the initiator falls back to analyzing that part locally. On a 50-billion-row table with 10 replicas, index analysis ran 4.3–7.7× faster (bloom filter, vector and full-text indexes gained the most), with a further 1.4–1.7× gain at 20 replicas.

Written by swe.quest, not by the author.

**Difficulty:** Hard: written for specialists in the field

## Topics

- [Query engines](https://swe.quest/tags/query-engines.md) (Data & databases)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Distributed databases](https://swe.quest/tags/distributed-databases.md) (Data & databases)
- [Memory management](https://swe.quest/tags/memory-management.md) (Compilers & runtimes)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- ClickHouse MergeTree parts and granules ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- sparse primary indexes
- consistent hashing
- compute-storage separation

## Keywords

ClickHouse Cloud, MergeTree, parallel replicas, distributed\_index\_analysis, bloom filter, vector search, full-text index

## Related posts

- [ClickHouse Release 23.3](https://swe.quest/articles/clickhouse-release-23-3-99009346ddff53ae.md): ClickHouse · 2023-04-13 · Medium · 8 min read · Analytics & OLAP, Distributed databases, Observability, SQL
  ClickHouse 23.3 LTS adds parallel replicas, which let multiple replicas of the same shard each process distinct data ranges assigned by an initiator node.
- [A Quadrillion Rows across three Clouds: scaling LogHouse](https://swe.quest/articles/a-quadrillion-rows-across-three-clouds-scaling-loghouse-ac5a7813ca827fb9.md): ClickHouse · 2026-06-30 · Medium · 20 min read · Observability, Analytics & OLAP, Scaling, Distributed databases, Storage engines
  LogHouse, ClickHouse Cloud's internal logging platform, has grown to 431 PiB uncompressed (27 PiB on disk) and 1.59 quadrillion rows across 36 cells in 33 geoshards on three clouds, ingesting up to 80 GiB/s and 190M rows/s.
- [How we scaled raw GROUP BY to 100 B+ rows in under a second](https://swe.quest/articles/how-we-scaled-raw-group-by-to-100-b-rows-in-under-a-second-c36aee54a6541514.md): ClickHouse · 2025-09-29 · Medium · 23 min read · Query engines, Analytics & OLAP, Performance engineering, Distributed databases, Scaling
  ClickHouse Cloud's parallel replicas feature spreads a single GROUP BY query across every core of every node in a service, with no pre-aggregation or data reshuffling.
- [ClickHouse Release 23.8](https://swe.quest/articles/clickhouse-release-23-8-8db1ebb65d969c75.md): ClickHouse · 2023-09-15 · Medium · 10 min read · Analytics & OLAP, Query engines, Data pipelines, Performance engineering
  ClickHouse 23.8 makes file reads much faster by using Parquet row-group min/max statistics to skip data, answering count() from file metadata, and pruning files via the \_file virtual column without reading them.
- [Super charging your ClickHouse queries](https://swe.quest/articles/super-charging-your-clickhouse-queries-55ad4f3a6c2fa875.md): ClickHouse · 2022-12-15 · Medium · 15 min read · Analytics & OLAP, Performance engineering, Query engines, SQL
  ClickHouse query speed comes mainly from reading less data: a sparse primary index stores one entry per 8192-row granule and lets binary search skip blocks that can't match the WHERE clause.

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)
