mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-21 23:21:59 +00:00
add test
This commit is contained in:
parent
57a2a20900
commit
bd4385f969
@ -29,7 +29,7 @@ inline bool getVirtualRowFromChunk(const Chunk & chunk)
|
||||
const auto & info = chunk.getChunkInfo();
|
||||
if (const auto * read_info = typeid_cast<const MergeTreeReadInfo *>(info.get()))
|
||||
return read_info->virtual_row;
|
||||
return 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -0,0 +1,5 @@
|
||||
0
|
||||
1
|
||||
2
|
||||
3
|
||||
24578
|
@ -0,0 +1,48 @@
|
||||
|
||||
DROP TABLE IF EXISTS t;
|
||||
|
||||
CREATE TABLE t
|
||||
(
|
||||
`x` UInt64,
|
||||
`y` UInt64,
|
||||
`z` UInt64,
|
||||
`k` UInt64
|
||||
)
|
||||
ENGINE = MergeTree
|
||||
ORDER BY (x, y, z)
|
||||
SETTINGS index_granularity = 8192;
|
||||
|
||||
INSERT INTO t SELECT
|
||||
number,
|
||||
number,
|
||||
number,
|
||||
number
|
||||
FROM numbers(8192 * 3);
|
||||
|
||||
INSERT INTO t SELECT
|
||||
number + (8192 * 3),
|
||||
number + (8192 * 3),
|
||||
number + (8192 * 3),
|
||||
number + (8192 * 3)
|
||||
FROM numbers(8192 * 3);
|
||||
|
||||
SELECT x
|
||||
FROM t
|
||||
ORDER BY x ASC
|
||||
LIMIT 4
|
||||
SETTINGS max_block_size = 8192,
|
||||
read_in_order_two_level_merge_threshold = 0,
|
||||
max_threads = 1,
|
||||
optimize_read_in_order = 1;
|
||||
|
||||
SYSTEM FLUSH LOGS;
|
||||
|
||||
SELECT read_rows
|
||||
FROM system.query_log
|
||||
WHERE current_database = currentDatabase()
|
||||
AND query like '%SELECT x%'
|
||||
AND query not like '%system.query_log%'
|
||||
ORDER BY query_start_time DESC, read_rows DESC
|
||||
LIMIT 1;
|
||||
|
||||
DROP TABLE t;
|
Loading…
Reference in New Issue
Block a user