Fix explain indexes with use_skip_indexes_on_data_read + use_query_condition_cache#88504
Conversation
|
Workflow [PR], commit [d3a0ede] Summary: ❌
|
| } | ||
|
|
||
| const bool use_skip_indexes_on_data_read = settings[Setting::use_skip_indexes_on_data_read] && !is_parallel_reading_from_replicas; | ||
| const bool use_skip_indexes_on_data_read = settings[Setting::use_skip_indexes_on_data_read] && !is_parallel_reading_from_replicas && |
There was a problem hiding this comment.
Safe use of skip indexes in FINAL queries with use_skip_indexes_if_final_exact_mode=1 requires an additional PrimaryKeyExpand step and that step has to be done during full index analysis and cannot be postponed to data read time.
|
For Reference : 4 issues were found when testing this PR
Enabling |
| if (is_parallel_reading_from_replicas) | ||
| return false; | ||
|
|
||
| if (settings[Setting::read_overflow_mode] == OverflowMode::THROW && settings[Setting::max_rows_to_read]) /// Need to do full index analysis to get row count estimate |
There was a problem hiding this comment.
This deserves a longer comment.
Maybe:
/// Settings `read_overflow_mode = 'throw'` and `max_rows_to_read` are evaluated early during execution, during initialization of the pipeline based on estimated row counts. Estimation doesn't work properly if the skip index is evaluated during data read (scan).| if (is_final_query && settings[Setting::use_skip_indexes_if_final_exact_mode]) | ||
| return false; | ||
|
|
||
| if (settings[Setting::read_overflow_mode] == OverflowMode::THROW && settings[Setting::max_rows_to_read]) /// Need to do full index analysis to get row count estimate |
There was a problem hiding this comment.
Needs a similarly long comment as above, see my proposal in the other comment.
|
|
c4d8c13
…n_data_read + use_query_condition_cache
Backport #88504 to 25.10: Fix explain indexes with use_skip_indexes_on_data_read + use_query_condition_cache
Changelog category (leave one):
Details
Fixes explain indexes with use_skip_indexes_on_data_read + use_query_condition_cache. Behavior change introduced and fixed in 25.10.
Resolves #88467