There is probably an unique feature of ClickHouse — aggregate states (addition to aggregate functions). You could refer to the documentation of AggregatingMergeTree and State combinator.
Recently I dived deep into ClickHouse. ClickHouse is column-store database by Yandex with great performance for analytical queries. For example check benchmark and post of Mark Litwintschik.