Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

system.hypothetical_indexes

Lists every hypothetical (what-if) skip index defined in the current session. See CREATE HYPOTHETICAL INDEX and EXPLAIN WHATIF.

The contents are session-scoped: each connection sees only its own hypothetical indexes, and the table is empty when no indexes have been created in the current session.

The current (database, table) are resolved by UUID at query time, so they reflect RENAME TABLE and entries for dropped tables are hidden automatically.

Columns

  • database (String) — Database name
  • table (String) — Table name
  • name (String) — Index name
  • type (String) — Index type (minmax, set, bloom_filter, etc)
  • type_full (String) — Index type expression with arguments, e.g. bloom_filter(0.01)
  • expression (String) — Index expression
  • granularity (UInt64) — Index granularity

Example

CREATE HYPOTHETICAL INDEX i1 ON t (b) TYPE bloom_filter(0.01)  GRANULARITY 1;
CREATE HYPOTHETICAL INDEX i2 ON t (b) TYPE bloom_filter(0.001) GRANULARITY 1;

SELECT database, table, name, type, type_full, expression, granularity
FROM system.hypothetical_indexes;
┌─database─┬─table─┬─name─┬─type─────────┬─type_full───────────┬─expression─┬─granularity─┐
│ default  │ t     │ i1   │ bloom_filter │ bloom_filter(0.01)  │ b          │           1 │
│ default  │ t     │ i2   │ bloom_filter │ bloom_filter(0.001) │ b          │           1 │
└──────────┴───────┴──────┴──────────────┴─────────────────────┴────────────┴─────────────┘

type is the base type name and type_full includes the arguments, so users can distinguish between parametrized variants like bloom_filter(0.01) and bloom_filter(0.001).

See also

Navigation