fix (clickhouse): ReplacingMergeTree for sessions table

This commit is contained in:
ShiKhu 2021-05-10 12:38:39 +02:00
parent 0cc5f37b0a
commit 0203ed8ea1

View file

@ -16,7 +16,7 @@ CREATE TABLE sessions (
pages_count UInt16,
events_count UInt16,
errors_count UInt16
) ENGINE = MergeTree
) ENGINE = ReplacingMergeTree( duration )
PARTITION BY toDate(datetime)
ORDER BY (project_id, datetime)
ORDER BY (project_id, datetime, session_id)
TTL datetime + INTERVAL 1 MONTH;