diff --git a/tests/queries/0_stateless/01344_min_bytes_to_use_mmap_io_index.reference b/tests/queries/0_stateless/01344_min_bytes_to_use_mmap_io_index.reference new file mode 100644 index 00000000000..ac3ce287de5 --- /dev/null +++ b/tests/queries/0_stateless/01344_min_bytes_to_use_mmap_io_index.reference @@ -0,0 +1,2 @@ +Hello, world +2 diff --git a/tests/queries/0_stateless/01344_min_bytes_to_use_mmap_io_index.sql b/tests/queries/0_stateless/01344_min_bytes_to_use_mmap_io_index.sql new file mode 100644 index 00000000000..67baef7136d --- /dev/null +++ b/tests/queries/0_stateless/01344_min_bytes_to_use_mmap_io_index.sql @@ -0,0 +1,11 @@ +DROP TABLE IF EXISTS test_01344; +CREATE TABLE test_01344 (x String, INDEX idx (x) TYPE set(10) GRANULARITY 1) ENGINE = MergeTree ORDER BY tuple(); +INSERT INTO test_01344 VALUES ('Hello, world'); + +SET min_bytes_to_use_mmap_io = 1; +SELECT * FROM test_01344 WHERE x = 'Hello, world'; + +SYSTEM FLUSH LOGS; +SELECT PE.Values FROM system.query_log ARRAY JOIN ProfileEvents AS PE WHERE event_date >= yesterday() AND event_time >= now() - 300 AND query LIKE 'SELECT * FROM test_01344 WHERE x = ''Hello, world''%' AND PE.Names = 'CreatedReadBufferMMap' AND type = 2 ORDER BY event_time DESC LIMIT 1; + +DROP TABLE test_01344;