From 9f1fef5c45e6e5773610f3f6596e4cd30e736e6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=AE=BD?= Date: Tue, 21 Mar 2023 09:16:43 +0000 Subject: [PATCH] Upload New File --- .../22.11_LTS_建表语句/update.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 Clickhouse最新全量建表语句/22.11_LTS_建表语句/update.sql diff --git a/Clickhouse最新全量建表语句/22.11_LTS_建表语句/update.sql b/Clickhouse最新全量建表语句/22.11_LTS_建表语句/update.sql new file mode 100644 index 0000000..e9dced3 --- /dev/null +++ b/Clickhouse最新全量建表语句/22.11_LTS_建表语句/update.sql @@ -0,0 +1,18 @@ +set distributed_ddl_task_timeout = 180; + + +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_all modify TTL event_date + INTERVAL 60 DAY;