diff --git a/Clickhouse最新全量建表语句/TSG_OLAP_PRIMARY_KEY_LOG_ID/Clickhouse_TSG_建表语句.sql b/Clickhouse最新全量建表语句/TSG_OLAP_PRIMARY_KEY_LOG_ID/Clickhouse_TSG_建表语句.sql index d1486ee..500744c 100644 --- a/Clickhouse最新全量建表语句/TSG_OLAP_PRIMARY_KEY_LOG_ID/Clickhouse_TSG_建表语句.sql +++ b/Clickhouse最新全量建表语句/TSG_OLAP_PRIMARY_KEY_LOG_ID/Clickhouse_TSG_建表语句.sql @@ -5227,3 +5227,5 @@ ENGINE =Distributed(ck_cluster,tsg_galaxy_v3,active_defence_event_local,rand()); alter table tsg_galaxy_v3.session_record_local on cluster ck_cluster add INDEX IF NOT EXISTS client_index common_client_ip type bloom_filter(0.05) GRANULARITY 1; alter table tsg_galaxy_v3.transaction_record_local on cluster ck_cluster add INDEX IF NOT EXISTS client_index common_client_ip type bloom_filter(0.05) GRANULARITY 1; alter table tsg_galaxy_v3.interim_session_record_local on cluster ck_cluster add INDEX IF NOT EXISTS client_index common_client_ip type bloom_filter(0.05) GRANULARITY 1; + +alter table system.query_log on cluster ck_cluster modify TTL event_date + INTERVAL 30 DAY; \ No newline at end of file diff --git a/Clickhouse最新全量建表语句/TSG_OLAP_PRIMARY_KEY_VSYS_ID/Clickhouse_TSG_建表语句.sql b/Clickhouse最新全量建表语句/TSG_OLAP_PRIMARY_KEY_VSYS_ID/Clickhouse_TSG_建表语句.sql index 845e58e..f7aba1c 100644 --- a/Clickhouse最新全量建表语句/TSG_OLAP_PRIMARY_KEY_VSYS_ID/Clickhouse_TSG_建表语句.sql +++ b/Clickhouse最新全量建表语句/TSG_OLAP_PRIMARY_KEY_VSYS_ID/Clickhouse_TSG_建表语句.sql @@ -5215,3 +5215,5 @@ ENGINE =Distributed(ck_cluster,tsg_galaxy_v3,active_defence_event_local,rand()); alter table tsg_galaxy_v3.session_record_local on cluster ck_cluster add INDEX IF NOT EXISTS client_index common_client_ip type bloom_filter(0.05) GRANULARITY 1; alter table tsg_galaxy_v3.transaction_record_local on cluster ck_cluster add INDEX IF NOT EXISTS client_index common_client_ip type bloom_filter(0.05) GRANULARITY 1; alter table tsg_galaxy_v3.interim_session_record_local on cluster ck_cluster add INDEX IF NOT EXISTS client_index common_client_ip type bloom_filter(0.05) GRANULARITY 1; + +alter table system.query_log on cluster ck_cluster modify TTL event_date + INTERVAL 30 DAY; \ No newline at end of file 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 61241eb..c479de4 100644 --- a/TSG发布版本更新记录/TSG-23.01/clickhouse/update-23.01-ck.sql +++ b/TSG发布版本更新记录/TSG-23.01/clickhouse/update-23.01-ck.sql @@ -226,4 +226,6 @@ drop view IF EXISTS tsg_galaxy_v3.common_server_ip ON CLUSTER ck_cluster; CREATE MATERIALIZED VIEW IF NOT EXISTS tsg_galaxy_v3.common_client_ip ON CLUSTER ck_cluster TO tsg_galaxy_v3.session_record_common_client_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_http_domain ON CLUSTER ck_cluster TO tsg_galaxy_v3.session_record_http_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; 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; \ No newline at end of file +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