mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-10 01:25:21 +00:00
Add test for #26965
* Add a test for 'WITH'+CTE performance if enable_global_with_statement is enabled
This commit is contained in:
parent
892bcd183b
commit
6fe26d24e7
@ -0,0 +1,4 @@
|
||||
1000
|
||||
1000
|
||||
1000
|
||||
3
|
@ -0,0 +1,27 @@
|
||||
DROP TABLE IF EXISTS ev;
|
||||
DROP TABLE IF EXISTS idx;
|
||||
|
||||
CREATE TABLE ev (a Int32, b Int32) Engine=MergeTree() ORDER BY a;
|
||||
CREATE TABLE idx (a Int32) Engine=MergeTree() ORDER BY a;
|
||||
INSERT INTO ev SELECT number, number FROM numbers(100000000);
|
||||
INSERT INTO idx SELECT number*5 FROM numbers(1000);
|
||||
|
||||
SET enable_global_with_statement = 1;
|
||||
|
||||
-- test_enable_global_with_statement_performance_1
|
||||
WITH 'test' AS u SELECT count()FROM ev WHERE a IN (SELECT a FROM idx);
|
||||
|
||||
-- test_enable_global_with_statement_performance_2
|
||||
SELECT count() FROM ev WHERE a IN (SELECT a FROM idx);
|
||||
|
||||
SET enable_global_with_statement = 0;
|
||||
|
||||
-- test_enable_global_with_statement_performance_3
|
||||
WITH 'test' AS u SELECT count() FROM ev WHERE a IN (SELECT a FROM idx);
|
||||
|
||||
SYSTEM FLUSH LOGS;
|
||||
|
||||
SELECT count(read_rows) FROM (SELECT read_rows FROM system.query_log WHERE current_database=currentDatabase() AND type='QueryFinish' AND query LIKE '%test_enable_global_with_statement_performance%' ORDER BY event_date, event_time DESC LIMIT 3) GROUP BY read_rows;
|
||||
|
||||
DROP TABLE IF EXISTS ev;
|
||||
DROP TABLE IF EXISTS idx;
|
Loading…
Reference in New Issue
Block a user