Introducing Inverted Indices in ClickHouse
ClickHouse v23.1 adds experimental inverted indexes (contributed by IBM) as MergeTree secondary indexes for full-text term search. Dictionaries are stored as minimized finite state transducers mapping terms to posting-list offsets, and posting lists are compressed with roaring bitmaps for fast unions and intersections. Indexes are built per part with single-pass in-memory inversion into segments stored across metadata, dictionary and posting-list files, so lookups never load the whole index. On 28.7M Hacker News comments, a hasToken query drops from 0.843s to 0.248s (about 3.4x), though part merges currently rebuild the index from scratch.
Related posts
- Inside ClickHouse full-text search: fast, native, and columnar
ClickHouse mediumAdept
ClickHouse rebuilt its full-text search around a native inverted "text" index that replaces the earlier Bloom-filter indexes (tokenbf_v1, ngrambf_v1), which were hard to tune, returned false positives and supported few predicates. Token dictionaries are stored as finite state transducers that share prefixes and emit posting-list offsets. Posting lists are Roaring bitmaps, which give compact storage and SIMD-friendly AND/OR/NOT operations. On disk the index is built per part from ID, metadata, Bloom filter, dictionary and posting-list files, optionally split into dictionary-size-bounded segments to avoid OOM during builds, and it adds a cleaner key-value index syntax and a split tokenizer for logs and CSV-style data. This implementation has since been deprecated in favour of a newer one that went GA in March 2026.
- Announcing General Availability of ClickHouse Full-text Search
ClickHouse mediumAdept
ClickHouse Full-text Search is now generally available, implemented as a Lucene-style inverted index that maps tokens to row numbers using configurable tokenizers and preprocessors defined in SQL. Unlike granule-level Bloom filter skip indexes, it is deterministic, supports multi-token search and scales better. It does not do relevance scoring or directly accelerate phrase search. On a 10-billion-row GitHub events dataset, a token search with monthly aggregation dropped from 193s with a linear scan and 143s with a Bloom filter to 0.42s with the text index. The costs are roughly 50% lower insert throughput and larger index storage than Bloom filters.
- Building high-performance full-text search for object storage
ClickHouse hardMaster
ClickHouse redesigned its full-text index for object storage, where per-request latency rather than bandwidth is the bottleneck. The old FST-based dictionary relied on many small random reads, so it was replaced with alphabetically sorted, front-coded dictionary blocks (default 512 tokens) located through a small in-memory sparse index, letting lookups proceed mostly sequentially. Posting lists adapt to size: Roaring bitmaps with per-block min/max row IDs for lists over 12 rows, VarInt arrays for 7–12, and row IDs embedded directly in the dictionary entry for 6 or fewer. Measurements on log and FineWeb datasets back the embedded case: about 90% or more of tokens appear in six or fewer rows. The layout also speeds up part merges, and many queries can be answered from the index alone without reading the text column.
- What's new in ClickStack. January '26.
ClickHouse mediumAdept
ClickStack now supports ClickHouse's simpler bloom_filter skip index with explicit tokens() tokenization for log body search, replacing hard-to-tune tokenbf_v1 parameters with a single false-positive rate. That yields roughly 15% smaller indexes, up to 50% faster index analysis and searches up to 5x faster. It also adds UI support for ClickHouse's beta inverted text index via hasAllTokens, which ran about 9x faster than the bloom filter on an OpenTelemetry demo query while reading over 100x less data. That index requires ClickHouse 25.12+, the splitByNonAlpha tokenizer and a 64-token-per-call limit. Alerts now automatically use registered materialized views, and the month also brought the launch of Managed ClickStack on ClickHouse Cloud, priced on compute and storage.
- ClickHouse Release 23.1
ClickHouse mediumAdept
ClickHouse 23.1 adds experimental inverted full-text indices as a data-skipping index, parameterized views, and a TTL-based query results cache, alongside 17 features, 17 performance optimisations and 78 bug fixes. On Hacker News data, the inverted index cuts a token-match query from 0.56s scanning 34M rows to 0.29s scanning 6M rows. It stores no term positions or relevancy statistics and supports only whitespace or n-gram tokenization, so it accelerates token matching but does not replace a search engine. The query cache is deliberately not transactionally consistent: entries expire only by TTL, trading accuracy for performance in OLAP workloads like dashboards.