with toStartOfInterval(event_time,toIntervalSecond(60)) As time_
SELECT time_ , count(), avg(query_duration_ms), max(query_duration_ms) FROM system.query_log
WHERE event_time between '2024-01-01 00:00:00' and '2024-01-22 00:00:00' AND type='QueryFinish'
GROUP BY time_ ORDER BY count() DESC
结果示例
时间 | 时间范围内的查询数 | 平均耗时 | 最大耗时 |
---|---|---|---|
2024-01-19 04:03:00 | 9383 | 74.36374293935842 | 1119 |
2024-01-19 04:02:00 | 9381 | 74.36374293935842 | 1119 |
注意: 本文归作者所有, 未经作者允许, 不得转载. 若有谬误, 欢迎指出