ClickHouse/tests/queries/0_stateless/01356_view_threads.sql
Alexey Milovidov 4ba8d84694 Adjust tests
2023-02-27 07:10:02 +01:00

16 lines
781 B
SQL

-- Tags: no-parallel
-- no-parallel: it checks the number of threads, which can be lowered in presence of other queries
drop table if exists table_01356_view_threads;
create view table_01356_view_threads as select number % 10 as g, sum(number) as s from numbers_mt(1000000) group by g;
set log_queries = 1;
set max_threads = 16;
select g % 2 as gg, sum(s) from table_01356_view_threads group by gg order by gg;
system flush logs;
select length(thread_ids) >= 16 from system.query_log where current_database = currentDatabase() AND event_date >= today() - 1 and lower(query) like '%select g % 2 as gg, sum(s) from table_01356_view_threads group by gg order by gg%' and type = 'QueryFinish' order by query_start_time desc limit 1;
drop table if exists table_01356_view_threads;