How to avoid merging high cardinality sub-select aggregations on distributed tables
问题 In Clickhouse, I have a large table A with following columns: date, user_id, operator, active In table A, events are already pre-aggregated over date, user_id and operator, while column 'active' indicates presence of certain kind of activity of user on given date. Table A is distributed over 2 shards/servers: First I created table A_local on each server (PK is date, user_id). Then I created distributed table A to merge local tables A_local by using hash(userid, operator) as sharding key. User