Github user kumarvishal09 commented on a diff in the pull request:
https://github.com/apache/carbondata/pull/1886#discussion_r165641742
--- Diff: docs/data-management-on-carbondata.md ---
@@ -748,6 +749,250 @@ This tutorial is going to introduce all commands and
data operations on CarbonDa
* The partitioned column can be excluded from SORT_COLUMNS, this will
let other columns to do the efficient sorting.
* When writing SQL on a partition table, try to use filters on the
partition column.
+## PRE-AGGREGATE TABLES
+ Carbondata supports pre aggregating of data so that OLAP kind of queries
can fetch data
+ much faster.Aggregate tables are created as datamaps so that the
handling is as efficient as
+ other indexing support.Users can create as many aggregate tables they
require as datamaps to
+ improve their query performance,provided the storage requirements and
loading speeds are
+ acceptable.
+
+ For main table called **sales** which is defined as
+
+ ```
+ CREATE TABLE sales (
+ order_time timestamp,
+ user_id string,
+ sex string,
+ country string,
+ quantity int,
+ price bigint)
+ STORED BY 'carbondata'
+ ```
+
+ user can create pre-aggregate tables using the DDL
+
+ ```
+ CREATE DATAMAP agg_sales
+ ON TABLE sales
+ USING "preaggregate"
+ AS
+ SELECT country, sex, sum(quantity), avg(price)
+ FROM sales
+ GROUP BY country, sex
+ ```
+
+<b><p align="left">Functions supported in pre-aggregate tables</p></b>
+
+| Function | Rollup supported |
+|-----------|----------------|
+| SUM | Yes |
+| AVG | Yes |
+| MAX | Yes |
+| MIN | Yes |
+| COUNT | Yes |
+| DISTINCT COUNT | No |
--- End diff --
Currently we are not supporting distinct count and in future only for
timeseries we can support
---