修改 表引擎 和排序键

This commit is contained in:
wuaho 2021-09-07 16:30:47 +08:00
parent 6603e14434
commit 73becdce74

View File

@ -1,5 +1,5 @@
drop table if exists xiangsu.event;
create table xiangsu.event
drop table if exists debug.event;
create table debug.event
(
`#ip` Nullable(IPv4),
`#country` Nullable(String),
@ -44,12 +44,8 @@ create table xiangsu.event
`#account_id` String,
`#distinct_id` Nullable(String),
`#event_name` String,
`#server_time` DateTime('UTC') default now(),
`sign` Int8 default 1
) ENGINE = CollapsingMergeTree(sign)
`#server_time` DateTime('UTC') default now()
) ENGINE = ReplacingMergeTree()
PARTITION BY toYYYYMMDD(`#event_time`)
order by (`#event_name`, `#event_time`, `#account_id`)
-- TTL event_time + toIntervalDay(365)