ByConity常用SQL語句詳解
更新時間:2023年09月07日 09:08:42 作者:cheng1483
這篇文章主要介紹了ByConity常用SQL語句,本文通過實例代碼給大家介紹的非常詳細,對大家的學習或工作具有一定的參考借鑒價值,需要的朋友可以參考下
ByConity常用SQL語句
Merger任務
-- 查詢merger任務狀態(tài) SELECT * FROM system.manipulations; -- 調整表 Merger 任務 alter table log.ck_logs_box_10 modify setting cnch_merge_pick_worker_algo='RoundRobin'; -- 查看后臺累計任務 SELECT * FROM system.bg_threads WHERE database = 'log' AND table = 'web_tools'; -- 查看當前 Merger 情況 select * from system.manipulations; -- 查看當前 Merge 并發(fā)任務量 SELECT type, database,table, related_node, count(1) FROM system.manipulations group by type, database,table,related_node;
查詢語句設置
-- 設置 查詢時最大執(zhí)行時間(單位:s): settings max_execution_time = 300; select ck_date, kind, count() from log.ck_logs_box_10 group by ck_date, kind settings max_execution_time = 300;
表相關設置
-- 調整表為不使用緩存 enable_local_disk_cache = 0, 用緩存的話 設置為 1 alter table log.ck_logs_box_10 modify setting enable_local_disk_cache = 0; -- 配置為 reard 端主動讀取數據 enable_preload_parts = 1,不使用設置為 0 alter table log.ck_logs_box_10 modify setting enable_preload_parts = 0;
刪除數據
-- 刪除分區(qū)數據 ALTER TABLE log.ck_logs_box_10 DROP PARTITION '20230706'
Parts 相關
-- 查看 parts select partition_id, part_type, count(), formatReadableSize(sum(bytes_on_disk)) FROM system.cnch_parts where database='log' and table='ck_logs_box_10' and part_type='VisiblePart' group by partition_id, part_type order by partition_id; -- 查看 指定日期的 parts select name, rows_count, marks_count, formatReadableSize(bytes_on_disk) FROM system.cnch_parts where database='log' and table='ck_logs_box_10' and part_type='VisiblePart' and partition_id = '20230719' order by bytes_on_disk desc ;
Kafka 引擎配置使用
-- 查看Kafka 消費日志, 有錯誤時,也可以在這里看到 SELECT event_type, event_time, consumer, formatReadableSize(bytes), has_error, exception FROM cnch_system.cnch_kafka_log WHERE event_date = today() AND cnch_database = 'kafka_consume' AND cnch_table = 'ck_logs_box_10' AND event_time > now() - 600 ORDER BY event_time desc; -- 查看 消費情況 SELECT * FROM system.cnch_kafka_tables WHERE database = 'kafka_consume' limit 10; -- 將kafka 引擎停止 SYSTEM STOP CONSUME kafka_consume.ck_logs_box_10; -- 將kafka 引擎開始 SYSTEM START CONSUME kafka_consume.ck_logs_box_10; -- 將kafka 引擎重啟 SYSTEM RESTART CONSUME kafka_consume.ck_logs_box_10;
到此這篇關于ByConity常用SQL語句的文章就介紹到這了,更多相關ByConity常用SQL語句內容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關文章希望大家以后多多支持腳本之家!
相關文章
SQL?Server2019安裝的詳細步驟實戰(zhàn)記錄(親測可用)
SQL Server 2019作為編程人員必須使用到的一款數據庫管理軟件,許多初學者在安裝這款軟件的時候都出現了各種各樣的問題,下面這篇文章主要給大家介紹了關于SQL?Server2019安裝的詳細步驟,需要的朋友可以參考下2022-06-06
使用SQL語句創(chuàng)建數據庫與創(chuàng)建表操作指南
這篇文章主要給大家介紹了關于使用SQL語句創(chuàng)建數據庫與創(chuàng)建表操作的相關資料,創(chuàng)建數據庫是數據庫管理的第一步,而SQL語句是創(chuàng)建數據庫的基本工具,需要的朋友可以參考下2023-08-08
sqlserver 無法驗證產品密匙的完美解決方案[測試通過]
Win2003 SQL2000時CD-KEY(序列號)無法驗證的問題的解決方法2009-07-07

