Skip to main content
Skip to main content
Edit this page

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

ColumnTypeDescription
databaseStringTarget database.
tableStringTarget table.
nameStringIndex name.
typeStringIndex type (minmax, set, bloom_filter, etc.).
type_fullStringIndex type expression including arguments, e.g. bloom_filter(0.01).
expressionStringIndex expression as written in CREATE HYPOTHETICAL INDEX.
granularityUInt64Number of data granules per index granule.

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