---
title: "Making complex JSON 58x faster, use 3,300x less memory, in ClickHouse"
description: "ClickHouse v25.8 adds two new on-disk serializations for the JSON type's shared data, which holds paths beyond the 1,024 dynamic-subcolumn limit."
url: "https://swe.quest/articles/making-complex-json-58x-faster-use-3-300x-less-memory-in-clickhouse-7431021b1253a468"
canonical: "https://clickhouse.com/blog/json-data-type-gets-even-better"
source: "ClickHouse"
published: "2025-10-09"
difficulty: "hard"
kind: "Deep dive"
reading_minutes: 7
tags: ["storage-engines","analytics","performance"]
---

# Making complex JSON 58x faster, use 3,300x less memory, in ClickHouse

A post on [ClickHouse](https://swe.quest/sources/clickhouse.md), published 2025-10-09, 7 min read, Deep dive. Original: [https://clickhouse.com/blog/json-data-type-gets-even-better](https://clickhouse.com/blog/json-data-type-gets-even-better)

## Summary

ClickHouse v25.8 adds two new on-disk serializations for the JSON type's shared data, which holds paths beyond the 1,024 dynamic-subcolumn limit. Previously, reading such a path meant loading and filtering an entire Map(String, String) column. A bucketed format hashes paths into separate maps so only one bucket is read. An advanced format adds per-granule .structure, .paths\_marks and substream files, so queries can skip granules and seek directly to a path or a nested subcolumn. To keep full-document reads and merges fast, the original map layout is stored alongside the advanced one, roughly doubling storage. On 200k rows with 10k paths, selective reads ran about 58x faster with about 3,300x less memory, and whole-document reads stayed close to the original format.

Written by swe.quest, not by the author.

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

## Topics

- [Storage engines](https://swe.quest/tags/storage-engines.md) (Data & databases)
- [Analytics & OLAP](https://swe.quest/tags/analytics.md) (Data & databases)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)

## Prerequisites

- ClickHouse MergeTree parts ([easy posts on Analytics & OLAP](https://swe.quest/tags/analytics.md?difficulty=easy))
- columnar storage
- granules and marks

## Keywords

ClickHouse, JSON data type, MergeTree, ClickHouse v25.8

## Related posts

- [ClickHouse Newsletter April 2022: JSON, JSON, JSON](https://swe.quest/articles/clickhouse-newsletter-april-2022-json-json-json-d21f592453b8c7ef.md): ClickHouse · 2022-04-14 · Medium · 5 min read · Analytics & OLAP, Databases, SQL
  ClickHouse 22.3 LTS adds an experimental JSON data type that stores semi-structured documents in a single column, with dynamic subcolumns underneath, so you no longer need hand-built schemas of arrays and materialized columns.
- [The billion docs JSON Challenge: ClickHouse vs. MongoDB, Elasticsearch, and more](https://swe.quest/articles/the-billion-docs-json-challenge-clickhouse-vs-mongodb-elasticsearch-and-more-e942a192bad31355.md): ClickHouse · 2025-01-29 · Medium · 28 min read · Analytics & OLAP, Databases, Storage engines, Performance engineering
  JSONBench is a reproducible benchmark that loads up to one billion Bluesky event JSON documents into ClickHouse, MongoDB, Elasticsearch, DuckDB and PostgreSQL, then measures storage size and the speed of five analytical queries.
- [How we built a new powerful JSON data type for ClickHouse](https://swe.quest/articles/how-we-built-a-new-powerful-json-data-type-for-clickhouse-cd5f151dcedf8d3e.md): ClickHouse · 2024-10-22 · Hard · 17 min read · Storage engines, Analytics & OLAP, Databases
  ClickHouse's new JSON type stores every JSON path as a true columnar, dense subcolumn, built on two standalone building blocks: Variant and Dynamic.
- [What really matters for performance: lessons from a year of benchmarks](https://swe.quest/articles/what-really-matters-for-performance-lessons-from-a-year-of-benchmarks-0ec8700c872ad4a4.md): ClickHouse · 2025-12-22 · Easy · 7 min read · Analytics & OLAP, Performance engineering, Caching, Databases
  Six ClickHouse benchmarks from 2025 point to one conclusion: performance depends on how efficiently an engine moves data end-to-end.
- [Christmas gifts from the ClickHouse engineering team](https://swe.quest/articles/christmas-gifts-from-the-clickhouse-engineering-team-0bd7782a3aa80a52.md): ClickHouse · 2026-01-20 · Medium · 7 min read · Analytics & OLAP, Query engines, Performance engineering, SQL
  ClickHouse 25.12 ships a batch of end-of-year improvements, from client usability tweaks (digit-group highlighting in the prompt, per-row readable numeric hints) to query engine optimizations. distinctJSONPaths now merges per-part JSON path metadata instead of decoding column data, cutting a 10M-row BlueSky query from 4.56 s to 82 ms. DISTINCT on LowCardinality columns now works on dictionary IDs with early exit, typically 2-6x faster, but slower on a sorting-key column where unique values are spread across the whole table.

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)
