Skip to content

Commit 979fa43

Browse files
authored
docs: Reading EXPLAIN ANALYZE output
1 parent e3e7e0e commit 979fa43

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

docs/docs-new/pages/product/caching/using-pre-aggregations.mdx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -573,6 +573,14 @@ used for query processing:
573573
+-----------+-----------------+--------------------------------------------------------------------------------------------------------------------------+
574574
```
575575

576+
In most of the cases for aggregation, Cube Store will use `HashAggregate` or `InplaceAggregate` strategy as well as `Merge` and `MergeSort` operators to union different partitions.
577+
Even for larger datasets, scan operations on sorted data will almost always be much more efficient and faster than hash aggregate as the Cube Store optimizer decides to use those only if there's an index with appropriate sorting.
578+
So, as a rule of thumb, if you see in your plan `PartialHashAggregate` and `FinalHashAggregate` nodes together with `Merge` operators those queries most likely perform sub-optimally.
579+
On another hand, if you see `PartialInplaceAggregate`, `FinalInplaceAggregate`, and `FullInplaceAggregate` together with `MergeSort` operators in your plan, then there's a high chance the query performs optimally.
580+
Sometimes, there can be exceptions to this rule.
581+
For example, a total count query run on top of the index will perform `HashAggregate` strategy on top of `MergeSort` nodes even if all required indexes are in place.
582+
This query would be optimal as well.
583+
576584
## Pre-Aggregations Storage
577585

578586
The default pre-aggregations storage in Cube is its own purpose-built storage

0 commit comments

Comments
 (0)