-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Analyzer: Skipping indexes don't work with VIEWs #69373
Copy link
Copy link
Closed
Labels
analyzerIssues and pull-requests related to new analyzerIssues and pull-requests related to new analyzeranalyzer-importantunexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.
Description
Describe the unexpected behaviour
Newer versions of clickhouse don't use indices on views which are defined as union
How to reproduce
CREATE TABLE tab_v1
(
content String,
INDEX idx_content_bloom content TYPE bloom_filter(0.01)
)
ENGINE = MergeTree
ORDER BY content
CREATE TABLE tab_v2
(
content String,
INDEX idx_content_bloom content TYPE bloom_filter(0.01)
)
ENGINE = MergeTree
ORDER BY content
CREATE VIEW tab_v3
AS SELECT *
FROM tab_v1
UNION ALL
SELECT *
FROM tab_v2
INSERT INTO tab_v1 (content) VALUES ('aaa bbb'), ('ccc ddd')
INSERT INTO tab_v2 (content) VALUES ('eee fff'), ('ggg hhh')
SELECT *
FROM tab_v3
WHERE content = 'iii'
SETTINGS force_data_skipping_indices='idx_content_bloom'
Expected behavior
Running on version 24.8.4.13 results on this:
Code: 277. DB::Exception: Received from localhost:9000. DB::Exception: Index `idx_content_bloom` is not used and setting 'force_data_skipping_indices' contains it. (INDEX_NOT_USED)
However, works fine on 23.10.3
Additional context
Just found a workaround for this, disabling allow_experimental_analyzer:
SELECT *
FROM tab_v3
WHERE content = 'iii'
SETTINGS force_data_skipping_indices='idx_content_bloom',allow_experimental_analyzer=0
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
analyzerIssues and pull-requests related to new analyzerIssues and pull-requests related to new analyzeranalyzer-importantunexpected behaviourResult is unexpected, but not entirely wrong at the same time.Result is unexpected, but not entirely wrong at the same time.