From 3624579f2ddf93babeaa168dcb94dba9306a55a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=BD?= Date: Wed, 1 Feb 2023 02:13:44 +0000 Subject: [PATCH] =?UTF-8?q?Update=20update-23.01-ck.sql=EF=BC=8C=E9=87=8D?= =?UTF-8?q?=E5=BB=BA=E7=B3=BB=E7=BB=9F=E8=A7=86=E5=9B=BE=E4=B8=8E=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E7=B3=BB=E7=BB=9F=E8=A1=A8=E5=90=8C=E6=AD=A5=E5=AD=97?= =?UTF-8?q?=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../TSG-23.01/clickhouse/update-23.01-ck.sql | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/TSG发布版本更新记录/TSG-23.01/clickhouse/update-23.01-ck.sql b/TSG发布版本更新记录/TSG-23.01/clickhouse/update-23.01-ck.sql index c479de4..8ee88c5 100644 --- a/TSG发布版本更新记录/TSG-23.01/clickhouse/update-23.01-ck.sql +++ b/TSG发布版本更新记录/TSG-23.01/clickhouse/update-23.01-ck.sql @@ -228,4 +228,19 @@ CREATE MATERIALIZED VIEW IF NOT EXISTS tsg_galaxy_v3.common_http_domain ON CLUST CREATE MATERIALIZED VIEW IF NOT EXISTS tsg_galaxy_v3.common_server_ip ON CLUSTER ck_cluster TO tsg_galaxy_v3.session_record_common_server_ip_local AS SELECT common_log_id, common_recv_time, common_server_ip, common_client_ip, common_sled_ip, common_entrance_id, common_subscriber_id, common_stream_trace_id, common_server_domain, http_domain, ssl_sni, common_schema_type, common_vsys_id, common_client_port, common_server_port, common_app_label, common_direction,common_data_center, common_device_group FROM tsg_galaxy_v3.session_record_local; CREATE MATERIALIZED VIEW IF NOT EXISTS tsg_galaxy_v3.common_server_domain ON CLUSTER ck_cluster TO tsg_galaxy_v3.session_record_common_server_domain_local AS SELECT common_log_id, common_recv_time, common_server_ip, common_client_ip, common_sled_ip, common_entrance_id, common_subscriber_id, common_stream_trace_id, common_server_domain, http_domain, ssl_sni, common_schema_type, common_vsys_id, common_client_port, common_server_port, common_app_label, common_direction,common_data_center, common_device_group FROM tsg_galaxy_v3.session_record_local; -alter table system.query_log on cluster ck_cluster modify TTL event_date + INTERVAL 30 DAY; \ No newline at end of file +drop table IF EXISTS `system`.query_log_cluster on cluster ck_query; +drop table IF EXISTS `system`.disks_cluster on cluster ck_query; +drop table IF EXISTS `system`.columns_cluster on cluster ck_query; +drop table IF EXISTS `system`.parts_cluster on cluster ck_query; +drop table IF EXISTS `system`.processes_cluster on cluster ck_query; +drop table IF EXISTS `system`.tables_cluster on cluster ck_query; + + +create table IF NOT EXISTS `system`.tables_cluster ON CLUSTER ck_query as `system`.tables ENGINE =Distributed(ck_all,`system`,tables,rand()); +create table IF NOT EXISTS `system`.disks_cluster ON CLUSTER ck_query as `system`.disks ENGINE =Distributed(ck_all,`system`,disks,rand()); +create table IF NOT EXISTS `system`.parts_cluster ON CLUSTER ck_query as `system`.parts ENGINE =Distributed(ck_all,`system`,parts,rand()); +create table IF NOT EXISTS `system`.query_log_cluster ON CLUSTER ck_query as `system`.query_log ENGINE =Distributed(ck_all,`system`,query_log,rand()); +CREATE TABLE IF NOT EXISTS `system`.columns_cluster ON CLUSTER ck_query AS `system`.columns ENGINE=Distributed(ck_all,`system`,columns,rand()); +CREATE TABLE IF NOT EXISTS `system`.processes_cluster ON CLUSTER ck_query AS `system`.processes ENGINE=Distributed(ck_all,`system`,processes,rand()); +alter table system.query_log on cluster ck_cluster modify TTL event_date + INTERVAL 30 DAY; +