1 CREATE TABLE dt (x DateTime) ENGINE = MergeTree ORDER BY tuple() CREATE TABLE dt64 (x DateTime64(3)) ENGINE = MergeTree ORDER BY tuple() INSERT INTO dt SELECT EventTime FROM hits_10m_single INSERT INTO dt64 SELECT toDateTime64(toDecimal64(toUInt64(EventTime), 3) + toDecimal64((rand() % 1000) / 1000, 3), 3) FROM hits_10m_single SELECT count() FROM dt where not ignore(x) SELECT count() FROM dt64 where not ignore(x) SELECT max(x) FROM dt SELECT max(x) FROM dt64 SELECT count() from dt where not ignore(toString(x)) SELECT count() from dt64 where not ignore(toString(x)) SELECT count() from dt where not ignore(toStartOfDay(x)) SELECT count() from dt64 where not ignore(toStartOfDay(x)) SELECT count() from dt where not ignore(toStartOfWeek(x)) SELECT count() from dt64 where not ignore(toStartOfWeek(x)) SELECT count() from dt where not ignore(toRelativeMinuteNum(x)) SELECT count() from dt64 where not ignore(toRelativeMinuteNum(x)) SELECT count() from dt where not ignore(addDays(x, 1)) SELECT count() from dt64 where not ignore(addDays(x, 1)) SELECT sum(x = x) FROM dt SELECT sum(x = x) FROM dt64 SELECT sum(toDateTime(toString(x)) != x) FROM dt SELECT sum(toDateTime64(toString(x), 3) != x) FROM dt64 DROP TABLE IF EXISTS dt DROP TABLE IF EXISTS dt64