You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// ########## Примеры SQL выборок для clickhouse ##########
select column,count(id) from dbname.tablename WHERE msec>NOW()-120 group by column order by column limit 100;
// ########## проверка на ReadOnly ##########
(while ! (echo "SELECT NOW()" | clickhouse-client -h clickhouse); do sleep 1; done) && (while (( $(echo "select count() from system.replicas where is_readonly" | clickhouse-client -h clickhouse) )); do sleep 1; done) &&
// ########## посчитать размеры таблиц ##########
select database, table, trunc(sum(data_compressed_bytes)/1000/1000/1000) as sizeGB from system.parts group by database, table order by sizeGB desc limit 10
// ########## установить TTL для записей в таблице лога запросов ##########
ALTER TABLE system.query_log MODIFY TTL event_date + INTERVAL 2 MONTH;