Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #53616 from wzb5212/skip_idx_bug_fix
Fix number of dropped granules in EXPLAIN PLAN index=1
- Loading branch information
Showing
7 changed files
with
69 additions
and
36 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
tests/queries/0_stateless/02866_size_of_marks_skip_idx_explain.reference
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Expression ((Project names + Projection)) | ||
Filter ((WHERE + Change column names to column identifiers)) | ||
ReadFromMergeTree (default.test_skip_idx) | ||
Indexes: | ||
Skip | ||
Name: name_idx_g2 | ||
Description: minmax GRANULARITY 2 | ||
Parts: 1/1 | ||
Granules: 2/5 | ||
Skip | ||
Name: name_idx_g1 | ||
Description: minmax GRANULARITY 1 | ||
Parts: 1/1 | ||
Granules: 1/2 | ||
Expression ((Project names + Projection)) | ||
Filter ((WHERE + Change column names to column identifiers)) | ||
ReadFromMergeTree (default.test_skip_idx) | ||
Indexes: | ||
Skip | ||
Name: name_idx_g2 | ||
Description: minmax GRANULARITY 2 | ||
Parts: 1/1 | ||
Granules: 2/5 | ||
Skip | ||
Name: name_idx_g1 | ||
Description: minmax GRANULARITY 1 | ||
Parts: 1/1 | ||
Granules: 2/2 |
24 changes: 24 additions & 0 deletions
24
tests/queries/0_stateless/02866_size_of_marks_skip_idx_explain.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
-- Tags: no-random-merge-tree-settings | ||
|
||
SET optimize_move_to_prewhere = 1; | ||
SET convert_query_to_cnf = 0; | ||
SET optimize_read_in_order = 1; | ||
|
||
SET allow_experimental_analyzer = 1; -- slightly different operator names than w/o | ||
|
||
DROP TABLE IF EXISTS test_skip_idx; | ||
|
||
CREATE TABLE test_skip_idx ( | ||
id UInt32, | ||
INDEX name_idx_g2 id TYPE minmax GRANULARITY 2, | ||
INDEX name_idx_g1 id TYPE minmax GRANULARITY 1) | ||
ENGINE = MergeTree | ||
ORDER BY tuple() | ||
SETTINGS index_granularity = 1, index_granularity_bytes = 0, min_bytes_for_wide_part = 0; | ||
|
||
INSERT INTO test_skip_idx SELECT number FROM system.numbers LIMIT 5 OFFSET 1; | ||
|
||
EXPLAIN indexes = 1 SELECT * FROM test_skip_idx WHERE id < 2; | ||
EXPLAIN indexes = 1 SELECT * FROM test_skip_idx WHERE id < 3; | ||
|
||
DROP TABLE test_skip_idx; |