drop table if exists tp; create table tp (type Int32, eventcnt UInt64, projection p (select sum(eventcnt), type group by type)) engine = ReplacingMergeTree order by type; insert into tp select number%3, 1 from numbers(3); insert into tp select number%3, 2 from numbers(3); optimize table tp final; set allow_experimental_projection_optimization = 0, force_optimize_projection = 0; select sum(eventcnt) eventcnt, type from tp group by type ┌─eventcnt─┬─type─┐ │ 2 │ 0 │ │ 2 │ 2 │ │ 2 │ 1 │ └──────────┴──────┘ set allow_experimental_projection_optimization = 1, force_optimize_projection = 1; select sum(eventcnt) eventcnt, type from tp group by type ┌─eventcnt─┬─type─┐ │ 3 │ 0 │ │ 3 │ 2 │ │ 3 │ 1 │ └──────────┴──────┘
ElPeque, markandrus, abionics, orginux, stephen-up and 2 more
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4