The start was in https://github.com/ClickHouse/ClickHouse/pull/11026
It turned out that the problem was due to the incorrect mutate()
implementation that lead to quadratic amount of column copying. This
problem has since been fixed.
Remove the excessively verbose logging, and also change appendToBlock of
LogElement's to accept mutable columns instead of accepting a block and
mutating it on each call. It looks wasteful, even though it is almost a
noop.
Can be used to write into query_log only failed queries (i.e. on memory
exceeded error), by using:
set log_queries_min_type='EXCEPTION_WHILE_PROCESSING'