DT
CREATE TABLE default.test_part
(
`ts` DateTime,
`dt` Date DEFAULT toDate(ts),
`db_time` DateTime DEFAULT ts
)
ENGINE = MergeTree()
PARTITION BY toDate(ts)
ORDER BY ts
SETTINGS index_granularity = 8192
select count() from test_part where toDate(ts)='2020-09-24';
Selected 31 parts by date, 31 parts by key, 105500 marks by primary key, 105500 marks to read from 33 ranges
select count() from test_part where ts>='2020-09-24 00:00:00' AND ts < '2020-09-25 00:00:00';
Selected 4 parts by date, 4 parts by key, 105471 marks by primary key, 105471 marks to read from 4 ranges