fix (clickhouse): ReplacingMergeTree for sessions table

This commit is contained in:
ShiKhu 2021-05-10 12:38:39 +02:00
parent 360e7bab74
commit afd9fbde7f

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;