ClickHouse/tests/queries/0_stateless/02125_query_views_log.sql

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

19 lines
902 B
MySQL
Raw Normal View History

2024-11-09 01:49:27 +00:00
SET output_format_pretty_single_large_number_tip_threshold = 0;
2024-11-09 00:01:46 +00:00
2021-11-25 18:06:57 +00:00
drop table if exists src;
drop table if exists dst;
drop table if exists mv1;
drop table if exists mv2;
create table src (key Int) engine=Null();
create table dst (key Int) engine=Null();
create materialized view mv1 to dst as select * from src;
create materialized view mv2 to dst as select * from src;
insert into src select * from numbers(1e6) settings log_queries=1, max_untracked_memory=0, parallel_view_processing=0;
2021-11-25 18:06:57 +00:00
system flush logs;
-- { echo }
select view_name, read_rows, read_bytes, written_rows, written_bytes from system.query_views_log where startsWith(view_name, currentDatabase() || '.mv') order by view_name format Vertical;
select read_rows, read_bytes, written_rows, written_bytes from system.query_log where type = 'QueryFinish' and query_kind = 'Insert' and current_database = currentDatabase() format Vertical;