From ec24bfe1286fd8bd84d24a824cce6227d1fc321c Mon Sep 17 00:00:00 2001 From: Alexey Milovidov Date: Mon, 24 Aug 2020 22:54:06 +0300 Subject: [PATCH] Added a test that proves feature exists --- .../01455_optimize_trivial_insert_select.reference | 2 ++ .../0_stateless/01455_optimize_trivial_insert_select.sql | 7 +++++++ 2 files changed, 9 insertions(+) create mode 100644 tests/queries/0_stateless/01455_optimize_trivial_insert_select.reference create mode 100644 tests/queries/0_stateless/01455_optimize_trivial_insert_select.sql diff --git a/tests/queries/0_stateless/01455_optimize_trivial_insert_select.reference b/tests/queries/0_stateless/01455_optimize_trivial_insert_select.reference new file mode 100644 index 00000000000..ebe978eef95 --- /dev/null +++ b/tests/queries/0_stateless/01455_optimize_trivial_insert_select.reference @@ -0,0 +1,2 @@ +1000000 0 +1000000 1 diff --git a/tests/queries/0_stateless/01455_optimize_trivial_insert_select.sql b/tests/queries/0_stateless/01455_optimize_trivial_insert_select.sql new file mode 100644 index 00000000000..de470fe6a57 --- /dev/null +++ b/tests/queries/0_stateless/01455_optimize_trivial_insert_select.sql @@ -0,0 +1,7 @@ +SET max_insert_threads = 1, max_threads = 100, min_insert_block_size_rows = 1048576, max_block_size = 65536; +CREATE TEMPORARY TABLE t (x UInt64); +-- For trivial INSERT SELECT, max_threads is lowered to max_insert_threads and max_block_size is changed to min_insert_block_size_rows. +INSERT INTO t SELECT * FROM numbers_mt(1000000); +SET max_threads = 1; +-- If data was inserted by more threads, we will probably see data out of order. +SELECT DISTINCT blockSize(), runningDifference(x) FROM t;