формулировках?
CREATE TABLE events (
timestamp DateTime,
id UInt64,
ip IPv4,
session_id UInt64,
lead_id Nullable(UInt64),
event String,
data String,
INDEX id_index event_id TYPE set(0) GRANULARITY 8192,
INDEX session_index (session_id) TYPE set(0) GRANULARITY 4,
INDEX lead_index (lead_id) TYPE set(0) GRANULARITY 4
) ENGINE = MergeTree()
PARTITION BY toYYYYMM(timestamp)
ORDER BY (timestamp)
PRIMARY KEY timestamp;
CREATE TABLE events (
timestamp DateTime,
id UInt64,
ip IPv4,
session_id UInt64,
lead_id Nullable(UInt64),
event String,
data String,
INDEX session_index (session_id) TYPE set(0) GRANULARITY 4,
INDEX lead_index (lead_id) TYPE set(0) GRANULARITY 4
) ENGINE = MergeTree(timestamp, (id), 8192)
PARTITION BY toYYYYMM(timestamp)
ORDER BY (timestamp)
PRIMARY KEY timestamp;
Второе неработающая каша. Смесь старого и нового синтаксиса. Не используйте синтаксис когда пишется внутри скобок.
Обсуждают сегодня