From 18c36a51c3c4d5ecb1afc2056f7b7fed3aaeba58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=BD?= Date: Mon, 26 Jun 2023 05:48:22 +0000 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A323.06=E5=AE=9E=E4=BD=93?= =?UTF-8?q?=E5=85=B3=E7=B3=BB=E5=BB=BA=E8=A1=A8=E8=AF=AD=E5=8F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Clickhouse最新全量建表语句/Clickhouse_CN_建表语句.sql | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/Clickhouse最新全量建表语句/Clickhouse_CN_建表语句.sql b/Clickhouse最新全量建表语句/Clickhouse_CN_建表语句.sql index 9900fa1..cc4191e 100644 --- a/Clickhouse最新全量建表语句/Clickhouse_CN_建表语句.sql +++ b/Clickhouse最新全量建表语句/Clickhouse_CN_建表语句.sql @@ -1709,7 +1709,7 @@ CREATE TABLE IF NOT EXISTS cyber_narrator_galaxy.metric_dns_rr_cname ON CLUSTER ) ENGINE = Distributed('ck_cluster', 'cyber_narrator_galaxy', 'metric_dns_rr_cname_local', rand()); - CREATE TABLE cyber_narrator_galaxy.cn_entity_relation_local on cluster ck_cluster +CREATE TABLE if not exists cyber_narrator_galaxy.cn_entity_relation_local on cluster ck_cluster ( app_name String, fqdn String, @@ -1722,10 +1722,9 @@ CREATE TABLE IF NOT EXISTS cyber_narrator_galaxy.metric_dns_rr_cname ON CLUSTER update_time Int64 ) ENGINE = MergeTree -ORDER BY (common_server_ip, - common_server_port, - common_app_label, - domain) +ORDER BY (ip, + fqdn, + app_name) TTL toDateTime(update_time) + toIntervalSecond(2592000), toDateTime(update_time) + toIntervalSecond(1) GROUP BY ip, fqdn, @@ -1770,7 +1769,7 @@ ENGINE = Distributed('ck_cluster', rand()); - CREATE TABLE cyber_narrator_galaxy.cn_dynamic_info_relation_local on cluster ck_cluster + CREATE TABLE if not exists cyber_narrator_galaxy.cn_dynamic_info_relation_local on cluster ck_cluster ( ip String, l7_protocol String,