SELECT count()
FROM example_table_MM
WHERE toDate(d) = toDate('2020-10-15')
┌─count()─┐
│ 1000000 │
└─────────┘
1 rows in set. Elapsed: 0.248 sec. Processed 1.00 million rows, 4.00 MB (4.03 million rows/s., 16.13 MB/s.)
:) select count() from example_table_MM where toDate(d)=toDate('2020-08-15'); -- shall be 2M, scans 5M
:-] ;
SELECT count()
FROM example_table_MM
WHERE toDate(d) = toDate('2020-08-15')
┌─count()─┐
│ 1000000 │
└─────────┘
1 rows in set. Elapsed: 0.248 sec. Processed 1.00 million rows, 4.00 MB (4.03 million rows/s., 16.10 MB/s.)
:) select count() from example_table_DD where toDate(d)=toDate('2020-09-24'); -- shall be 1M, scans 3M;
SELECT count()
FROM example_table_DD
WHERE toDate(d) = toDate('2020-09-24')
┌─count()─┐
│ 1000000 │
└─────────┘
1 rows in set. Elapsed: 0.248 sec. Processed 1.00 million rows, 4.00 MB (4.03 million rows/s., 16.11 MB/s.)