ByConity常用SQL語句詳解
ByConity常用SQL語句
Merger任務(wù)
-- 查詢merger任務(wù)狀態(tài) SELECT * FROM system.manipulations; -- 調(diào)整表 Merger 任務(wù) alter table log.ck_logs_box_10 modify setting cnch_merge_pick_worker_algo='RoundRobin'; -- 查看后臺(tái)累計(jì)任務(wù) SELECT * FROM system.bg_threads WHERE database = 'log' AND table = 'web_tools'; -- 查看當(dāng)前 Merger 情況 select * from system.manipulations; -- 查看當(dāng)前 Merge 并發(fā)任務(wù)量 SELECT type, database,table, related_node, count(1) FROM system.manipulations group by type, database,table,related_node;
查詢語句設(shè)置
-- 設(shè)置 查詢時(shí)最大執(zhí)行時(shí)間(單位: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;
表相關(guān)設(shè)置
-- 調(diào)整表為不使用緩存 enable_local_disk_cache = 0, 用緩存的話 設(shè)置為 1 alter table log.ck_logs_box_10 modify setting enable_local_disk_cache = 0; -- 配置為 reard 端主動(dòng)讀取數(shù)據(jù) enable_preload_parts = 1,不使用設(shè)置為 0 alter table log.ck_logs_box_10 modify setting enable_preload_parts = 0;
刪除數(shù)據(jù)
-- 刪除分區(qū)數(shù)據(jù) ALTER TABLE log.ck_logs_box_10 DROP PARTITION '20230706'
Parts 相關(guān)
-- 查看 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 消費(fèi)日志, 有錯(cuò)誤時(shí),也可以在這里看到 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; -- 查看 消費(fèi)情況 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;
到此這篇關(guān)于ByConity常用SQL語句的文章就介紹到這了,更多相關(guān)ByConity常用SQL語句內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
SQLServer創(chuàng)建索引的5種方法小結(jié)
本文主要介紹了SQLServer創(chuàng)建索引的5種方法小結(jié),文中通過示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來一起學(xué)習(xí)學(xué)習(xí)吧2023-04-04SqlServer備份數(shù)據(jù)庫(kù)的4種方式介紹
這篇文章主要介紹了SqlServer備份數(shù)據(jù)庫(kù)的4種方式介紹,本文講解了用sqlserver的維護(hù)計(jì)劃、通過腳本+作業(yè)的方式備份數(shù)據(jù)庫(kù)(非xp_cmdshell和xp_cmdshell)、用powershell調(diào)用sqlcmd來執(zhí)行備份命令幾種方式,需要的朋友可以參考下2015-02-02SQL Server實(shí)現(xiàn)查詢每個(gè)分組的前N條記錄
這篇文章介紹了SQL Server實(shí)現(xiàn)查詢每個(gè)分組的前N條記錄,文中通過示例代碼介紹的非常詳細(xì)。對(duì)大家的學(xué)習(xí)或工作具有一定的參考借鑒價(jià)值,需要的朋友可以參考下2022-06-06SQL?Server2019安裝的詳細(xì)步驟實(shí)戰(zhàn)記錄(親測(cè)可用)
SQL Server 2019作為編程人員必須使用到的一款數(shù)據(jù)庫(kù)管理軟件,許多初學(xué)者在安裝這款軟件的時(shí)候都出現(xiàn)了各種各樣的問題,下面這篇文章主要給大家介紹了關(guān)于SQL?Server2019安裝的詳細(xì)步驟,需要的朋友可以參考下2022-06-06使用SQL語句創(chuàng)建數(shù)據(jù)庫(kù)與創(chuàng)建表操作指南
這篇文章主要給大家介紹了關(guān)于使用SQL語句創(chuàng)建數(shù)據(jù)庫(kù)與創(chuàng)建表操作的相關(guān)資料,創(chuàng)建數(shù)據(jù)庫(kù)是數(shù)據(jù)庫(kù)管理的第一步,而SQL語句是創(chuàng)建數(shù)據(jù)庫(kù)的基本工具,需要的朋友可以參考下2023-08-08sqlserver 無法驗(yàn)證產(chǎn)品密匙的完美解決方案[測(cè)試通過]
Win2003 SQL2000時(shí)CD-KEY(序列號(hào))無法驗(yàn)證的問題的解決方法2009-07-07