и читает больше данных с диска?
SELECT count()
FROM test
WHERE (event_type_model_loaded = 1) AND (event_owner = '123') AND (event_date >= '2019-01-01') AND (event_date < '2019-10-01')
┌─count()─┐
│ 6811866 │
└─────────┘
1 rows in set. Elapsed: 0.426 sec. Processed 21.40 million rows, 343.35 MB (50.22 million rows/s., 805.88 MB/s.)
SELECT count()
FROM test
SAMPLE 5 / 10
WHERE (event_type_model_loaded = 1) AND (event_owner = '123') AND (event_date >= '2019-01-01') AND (event_date < '2019-10-01')
┌─count()─┐
│ 3406765 │
└─────────┘
1 rows in set. Elapsed: 1.375 sec. Processed 21.37 million rows, 684.94 MB (15.54 million rows/s., 498.12 MB/s.)
ORDER BY (event_owner, event_object_id, event_date, cityHash64(toString(client_id))) SAMPLE BY cityHash64(toString(client_id))
Обсуждают сегодня