Print out all queries to have better insights

This commit is contained in:
János Benjamin Antal 2024-03-12 14:05:39 +00:00
parent ed22c4c86e
commit b5489ac962
2 changed files with 29 additions and 5 deletions

View File

@ -1,2 +1,24 @@
11 queryfinish OK
11 querystart OK
"-- Attach MV to system.query_log and check that writing query_log will not fail\n\nset log_queries=1;","querystart","OK"
"-- Attach MV to system.query_log and check that writing query_log will not fail\n\nset log_queries=1;","queryfinish","OK"
"drop table if exists log_proxy_02572;","querystart","OK"
"drop table if exists log_proxy_02572;","queryfinish","OK"
"drop table if exists push_to_logs_proxy_mv_02572;","querystart","OK"
"drop table if exists push_to_logs_proxy_mv_02572;","queryfinish","OK"
"-- create log tables\nsystem flush logs;","querystart","OK"
"-- create log tables\nsystem flush logs;","queryfinish","OK"
"create table log_proxy_02572 as system.query_log engine=Distributed('test_shard_localhost', currentDatabase(), 'receiver_02572');","querystart","OK"
"create table log_proxy_02572 as system.query_log engine=Distributed('test_shard_localhost', currentDatabase(), 'receiver_02572');","queryfinish","OK"
"create materialized view push_to_logs_proxy_mv_02572 to log_proxy_02572 as select * from system.query_log;","querystart","OK"
"create materialized view push_to_logs_proxy_mv_02572 to log_proxy_02572 as select * from system.query_log;","queryfinish","OK"
"select 1 format Null;","querystart","OK"
"select 1 format Null;","queryfinish","OK"
"system flush logs;","querystart","OK"
"system flush logs;","queryfinish","OK"
"system flush logs;","querystart","OK"
"system flush logs;","queryfinish","OK"
"drop table log_proxy_02572;","querystart","OK"
"drop table log_proxy_02572;","queryfinish","OK"
"drop table push_to_logs_proxy_mv_02572;","querystart","OK"
"drop table push_to_logs_proxy_mv_02572;","queryfinish","OK"
"set log_queries=0;","querystart","OK"
"set log_queries=0;","queryfinish","OK"

View File

@ -21,10 +21,12 @@ system flush logs;
drop table log_proxy_02572;
drop table push_to_logs_proxy_mv_02572;
set log_queries=0;
system flush logs;
-- lower() to pass through clickhouse-test "exception" check
select count(), lower(type::String), errorCodeToName(exception_code)
select replaceAll(query, '\n', '\\n'), lower(type::String), errorCodeToName(exception_code)
from system.query_log
where current_database = currentDatabase()
group by 2, 3
order by 2;
order by event_time_microseconds
format CSV;