-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Fix EXPLAIN PLAN indexes = 1 in ClickHouse >= 25.9 #88467
Copy link
Copy link
Closed
Labels
unexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.
Description
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
- set
use_skip_indexes_on_data_read = 0, use_query_condition_cache = 0internally automatically when runningEXPLAIN PLAN indexes = 1, - revert changes a la
SET use_query_condition_cache = 0;done to our.sqland.shtests in above two PRs, - revert docs fix Docs: Add note for
EXPLAIN PLAN indexes = 1that recommends use_query_condition_cache = 1 #88462.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
unexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.