<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/clickhouse-hypothetical-indexes-pnv4tv1hj" -->

---
title: ClickHouse Hypothetical Indexes | daily.dev
description: ClickHouse 26.6 introduces hypothetical indexes and EXPLAIN WHATIF, letting engineers test candidate skip indexes without materializing them on disk. The...
canonical: https://daily.dev/posts/clickhouse-hypothetical-indexes-pnv4tv1hj
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: ClickHouse Hypothetical Indexes | daily.dev
og:description: ClickHouse 26.6 introduces hypothetical indexes and EXPLAIN WHATIF, letting engineers test candidate skip indexes without materializing them on disk. The...
og:url: https://daily.dev/posts/clickhouse-hypothetical-indexes-pnv4tv1hj
og:image: https://api.daily.dev/og/posts/PNv4Tv1Hj.png
og:image:alt: ClickHouse Hypothetical Indexes
og:image:width: 1200
og:image:height: 630
og:locale: 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 Hypothetical Indexes

**[BigData Boutique blog](https://daily.dev/sources/bigdataboutique)** · 9 min read · 1 upvotes · 0 comments

## Summary

ClickHouse 26.6 introduces hypothetical indexes and EXPLAIN WHATIF, letting engineers test candidate skip indexes without materializing them on disk. The feature mirrors PostgreSQL's HypoPG extension, reporting marks read, estimated bytes, and skip ratio per candidate via empirical scans or column statistics. A practical tuning workflow is outlined: find slow queries via system.query_log, register multiple index type/granularity variants, test against real production queries, and materialize only the winner. Skip ratio is emphasized as an upper bound on benefit, not a latency prediction, since read coalescing across granules isn't modeled. Limitations include no support for FINAL queries, projection-served queries, non-Atomic databases, and the cost of empirical scans on large tables. The piece also clarifies that the new hypothetical index feature is unrelated to the old, deprecated TYPE hypothesis skip index removed in ClickHouse 26.3.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://bigdataboutique.com/blog/clickhouse-hypothetical-indexes>

## Questions this post answers

### What are hypothetical indexes in ClickHouse and how does EXPLAIN WHATIF work?

Hypothetical indexes, introduced in ClickHouse 26.6, are virtual session-scoped skip index definitions that write nothing to disk. Creating one with CREATE HYPOTHETICAL INDEX registers a candidate, then EXPLAIN WHATIF runs against real queries to report marks read, estimated bytes, and skip_ratio per candidate, letting engineers compare index types and granularities before materializing anything.

_daily.dev surfaces practical ClickHouse tuning workflows for engineers deciding which skip index to actually build._

### How does ClickHouse EXPLAIN WHATIF estimate the skip ratio for a hypothetical index?

It uses a three-tier fallback: empirical mode (default) scans actual table data in memory to count skipped granules precisely; statistical mode, enabled with empirical = 0, derives selectivity from column statistics more cheaply but less accurately for very large tables; and applicability-only mode reports skip_ratio 0.0% when neither method can produce a number, only indicating whether the index type could apply.

_Engineers benchmarking ClickHouse skip indexes can track estimation methods like this through daily.dev._

### Is the old ClickHouse TYPE hypothesis skip index the same as the new hypothetical indexes feature?

No, they are unrelated despite the similar name. The experimental TYPE hypothesis skip index stored per-granule boolean assertions about conditions and was removed entirely in ClickHouse 26.3 due to low adoption and known bugs; tables with it must drop it before upgrading. Hypothetical indexes, added three releases later in 26.6, are a what-if analysis tool for existing standard skip index types, not a new index type.

_daily.dev helps developers upgrading ClickHouse spot naming collisions like this before they cause upgrade surprises._

## Similar posts on daily.dev

- [Index-based pruning in ClickHouse](https://daily.dev/posts/index-based-pruning-in-clickhouse-dgwhcajgi) · ClickHouse · 0 upvotes · 0 comments
- [ClickHouse Release 26.6](https://daily.dev/posts/clickhouse-release-26-6-3hujlqnzt) · ClickHouse · 1 upvotes · 0 comments
- [ClickHouse Will Let You Be Wrong at Scale](https://daily.dev/posts/clickhouse-will-let-you-be-wrong-at-scale-prxaelmw6) · Mat Duggan · 1 upvotes · 0 comments
- [HypoPG 1.4.4 is out\!](https://daily.dev/posts/hypopg-1-4-4-is-out--ohvqwkf0e) · PostgreSQL · 0 upvotes · 0 comments

---

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

[View this post on daily.dev](https://daily.dev/posts/clickhouse-hypothetical-indexes-pnv4tv1hj)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"ClickHouse Hypothetical Indexes","url":"https://daily.dev/posts/clickhouse-hypothetical-indexes-pnv4tv1hj","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/clickhouse-hypothetical-indexes-pnv4tv1hj"},"datePublished":"2026-08-27T12:01:06.749Z","dateModified":"2026-09-13T20:35:40.561Z","description":"ClickHouse 26.6 introduces hypothetical indexes and EXPLAIN WHATIF, letting engineers test candidate skip indexes without materializing them on disk. The...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/724adf9f1ee3fe5ff2361401dc98ce94?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/724adf9f1ee3fe5ff2361401dc98ce94?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"BigData Boutique blog","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"BigData Boutique blog","logo":"https://media.daily.dev/image/upload/s--3BDyon-q--/f_auto/v1717941801/logos/bigdataboutique","url":"https://daily.dev/sources/bigdataboutique"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/clickhouse-hypothetical-indexes-pnv4tv1hj","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"backend,sql,clickhouse","timeRequired":"PT9M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"BigData Boutique blog","item":"https://daily.dev/sources/bigdataboutique"},{"@type":"ListItem","position":3,"name":"ClickHouse Hypothetical Indexes"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/clickhouse-hypothetical-indexes-pnv4tv1hj#faq","mainEntity":[{"@type":"Question","name":"What are hypothetical indexes in ClickHouse and how does EXPLAIN WHATIF work?","acceptedAnswer":{"@type":"Answer","text":"Hypothetical indexes, introduced in ClickHouse 26.6, are virtual session-scoped skip index definitions that write nothing to disk. Creating one with CREATE HYPOTHETICAL INDEX registers a candidate, then EXPLAIN WHATIF runs against real queries to report marks read, estimated bytes, and skip_ratio per candidate, letting engineers compare index types and granularities before materializing anything. daily.dev surfaces practical ClickHouse tuning workflows for engineers deciding which skip index to actually build."}},{"@type":"Question","name":"How does ClickHouse EXPLAIN WHATIF estimate the skip ratio for a hypothetical index?","acceptedAnswer":{"@type":"Answer","text":"It uses a three-tier fallback: empirical mode (default) scans actual table data in memory to count skipped granules precisely; statistical mode, enabled with empirical = 0, derives selectivity from column statistics more cheaply but less accurately for very large tables; and applicability-only mode reports skip_ratio 0.0% when neither method can produce a number, only indicating whether the index type could apply. Engineers benchmarking ClickHouse skip indexes can track estimation methods like this through daily.dev."}},{"@type":"Question","name":"Is the old ClickHouse TYPE hypothesis skip index the same as the new hypothetical indexes feature?","acceptedAnswer":{"@type":"Answer","text":"No, they are unrelated despite the similar name. The experimental TYPE hypothesis skip index stored per-granule boolean assertions about conditions and was removed entirely in ClickHouse 26.3 due to low adoption and known bugs; tables with it must drop it before upgrading. Hypothetical indexes, added three releases later in 26.6, are a what-if analysis tool for existing standard skip index types, not a new index type. daily.dev helps developers upgrading ClickHouse spot naming collisions like this before they cause upgrade surprises."}}]}
```

