add inner and outer read-in-order virtual row test

This commit is contained in:
jsc0218 2024-09-19 14:48:38 +00:00
parent fd021f658d
commit 050b51799c
3 changed files with 53 additions and 1 deletions

View File

@ -196,7 +196,8 @@ CREATE TABLE distinct_in_order
)
ENGINE = MergeTree
ORDER BY (a, b)
SETTINGS index_granularity = 8192, index_granularity_bytes = '10Mi';
SETTINGS index_granularity = 8192,
index_granularity_bytes = '10Mi';
SYSTEM STOP MERGES distinct_in_order;

View File

@ -0,0 +1,25 @@
(Expression)
ExpressionTransform
(Sorting)
MergingSortedTransform 4 → 1
(Expression)
ExpressionTransform × 4
(ReadFromMergeTree)
ExpressionTransform × 5
VirtualRowTransform
MergeTreeSelect(pool: ReadPoolInOrder, algorithm: InOrder) 0 → 1
MergingSortedTransform 2 → 1
ExpressionTransform × 2
VirtualRowTransform
MergeTreeSelect(pool: ReadPoolInOrder, algorithm: InOrder) 0 → 1
VirtualRowTransform
MergeTreeSelect(pool: ReadPoolInOrder, algorithm: InOrder) 0 → 1
MergingSortedTransform 2 → 1
ExpressionTransform × 2
VirtualRowTransform
MergeTreeSelect(pool: ReadPoolInOrder, algorithm: InOrder) 0 → 1
VirtualRowTransform
MergeTreeSelect(pool: ReadPoolInOrder, algorithm: InOrder) 0 → 1
ExpressionTransform
VirtualRowTransform
MergeTreeSelect(pool: ReadPoolInOrder, algorithm: InOrder) 0 → 1

View File

@ -0,0 +1,26 @@
-- Tags: no-random-merge-tree-settings
SET optimize_read_in_order = 1, merge_tree_min_rows_for_concurrent_read = 1000;
DROP TABLE IF EXISTS tab;
CREATE TABLE tab
(
`t` DateTime
)
ENGINE = MergeTree
ORDER BY t
SETTINGS index_granularity = 1;
SYSTEM STOP MERGES tab;
INSERT INTO tab SELECT toDateTime('2024-01-10') + number FROM numbers(10000);
INSERT INTO tab SELECT toDateTime('2024-01-30') + number FROM numbers(10000);
INSERT INTO tab SELECT toDateTime('2024-01-20') + number FROM numbers(10000);
EXPLAIN PIPELINE
SELECT *
FROM tab
ORDER BY t ASC
SETTINGS read_in_order_two_level_merge_threshold = 0, max_threads = 4, read_in_order_use_buffering = 0
FORMAT tsv;