Запрос:
SELECT * FROM reporting_events WHERE (device_id = 51);
Результат:
DB::Exception: RangeReader read 7523 rows, but 7550 expected..
Таблица:
CREATE TABLE reporting_events (
id UInt64,
a UInt32,
b UInt64,
c UInt32,
d DEFAULT 0,
e UInt32 DEFAULT 0,
device_id UInt32,
ts DateTime DEFAULT now(),
name String,
type Enum8('ONLINE' = 0,
'OFFLINE' = 1,
'INFORMATION' = 2,
'WARNING' = 3,
'CRITICAL' = 4),
description String
)
ENGINE = MergeTree()
PARTITION BY toYYYYMM(ts)
ORDER BY (a, b, e, device_id, ts, type)
TTL ts + INTERVAL 6 MONTH;
Версия Clickhouse 20.1.3.7.