Skip to content

Fix EXPLAIN PLAN indexes = 1 in ClickHouse >= 25.9 #88467

@rschu1ze

Description

@rschu1ze

EXPLAIN PLAN indexes = 1 (docs) shows the result of primary and skip index analysis for a SELECT query.

Previously, ClickHouse

  • did primary key analysis
  • then did skip index analysis,
  • then checked the query condition cache ,
  • finally scanned the "surviving" ranges of the column.

As per #81526 (first appeared in ClickHouse v25.9), skip indexes are analyzed during scan. As a result, EXPLAIN PLAN indexes = 1 started to show incorrect output. Users need to run the query with SETTINGS use_skip_indexes_on_data_read = 0 to fix that.

Further, #82380 (first appears in ClickHouse v25.10) moves query condition cache probing before primary and skip index analysis. Again, EXPLAIN PLAN indexes = 1 started to show incorrect output. Users need to run the query with SETTINGS use_query_condition_cache = 0 to fix that.

We should

Metadata

Metadata

Assignees

Labels

unexpected behaviourResult is unexpected, but not entirely wrong at the same time.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions