From 5d08789602e2147ccb5636ed995d4a675d398943 Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Thu, 25 Jun 2020 22:48:12 +0300 Subject: [PATCH] Added a test --- .../01344_min_bytes_to_use_mmap_io_index.reference | 2 ++ .../01344_min_bytes_to_use_mmap_io_index.sql | 11 +++++++++++ 2 files changed, 13 insertions(+) create mode 100644 tests/queries/0_stateless/01344_min_bytes_to_use_mmap_io_index.reference create mode 100644 tests/queries/0_stateless/01344_min_bytes_to_use_mmap_io_index.sql 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;