Github user yucai commented on the issue:
https://github.com/apache/spark/pull/14481
@hvanhovell
**Benchmark Result**
**Summary**
We benchmark sortagg code gen with real custormers cases, and it improves
x6 when aggregating without keys, improves x1.18 when aggregating with keys.
**Workload**
Example 1: aggregate without keys
```
SELECT
mbuser_id,
max(substr(acc_nbr,1,15)) acc_nbr,
max(nbilling_tid) NBILLING_TID,
max(obilling_tid) OBILLING_TID,
max(BRAND_ID) BRAND_ID,
max(tm_tid) tm_tid,
max(area_id) AREA_ID,
max(VPMN_ID) VPMN_ID,
max(ACCT_ID) ACCT_ID,
â¦.
FROM gdi_mb GROUP BY MbUser_ID;
```
Example 2: aggregate with keys
```
SELECT
max(substr(acc_nbr,1,15)) acc_nbr,
max(nbilling_tid) NBILLING_TID,
max(obilling_tid) OBILLING_TID,
max(BRAND_ID) BRAND_ID,
max(tm_tid) tm_tid,
max(area_id) AREA_ID,
max(VPMN_ID) VPMN_ID,
max(ACCT_ID) ACCT_ID,
â¦.
FROM gdi_mb;
```
**Report (in seconds)**

In above workload pattern, sort actually occpies few time, most of time is
used in aggregation, that's the main reason why sortagg code gen speeds up.

---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]