You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ORCA: allow different strategy control the redistribute key below aggregate
In CBDB, if there is an AGG operator (one-step AGG or final AGG operator) that
requires data redistribution, then the redistribution motion operator will used
all `GROUP BY` keys as the redistribute keys. In fact, only a single key needs
to be redistributed, and the results of AGG will be the same.
Reducing the number of redistributed keys can effectively reduce the overhead
of hash function calls in motion operator. However, this may lead to data skew.
Therefore, the current commit provides several different strategies for deciding
how redistribution keys should be selected during redistribution motion operator
(which under the AGG operator). User can use the GUC `optimizer_agg_pds_strategy`
to select the strategies.
- OPTIMIZER_AGG_PDS_ALL_KEY(value: 0): default one, select all `GROUP BY` key as
the redistributed keys.
- OPTIMIZER_AGG_PDS_FIRST_KEY(value: 1): select the first `GROUP BY` key as the
redistributed keys.
- OPTIMIZER_AGG_PDS_MINIMAL_LEN_KEY(value: 2): select a `GROUP BY` key which has
the minimal and positive typlen as the redistributed keys. If only non-fixed
type (such as text and varchar) exist, select the first `GROUP BY` key.
- OPTIMIZER_AGG_PDS_EXCLUDE_NON_FIXED(value: 3): select the `GROUP BY` key which
is fixed typlen the redistributed keys. If only non-fixed type (such as text
and varchar) exist, select the first `GROUP BY` key.
0 commit comments