Enhancement
For string GROUP BY keys using a non-trivial collation such as
utf8mb4_general_ci, HashAgg currently generates a collation sort key for
every input row.
When the input has many repeated raw string values, the same sort key is
generated repeatedly. For example:
SELECT l_shipmode, COUNT(*)
FROM lineitem
GROUP BY l_shipmode;
If l_shipmode uses utf8mb4_general_ci and has a low NDV, sort-key
generation can consume a significant portion of the aggregation time.
Enhancement
For string
GROUP BYkeys using a non-trivial collation such asutf8mb4_general_ci, HashAgg currently generates a collation sort key forevery input row.
When the input has many repeated raw string values, the same sort key is
generated repeatedly. For example:
If l_shipmode uses utf8mb4_general_ci and has a low NDV, sort-key
generation can consume a significant portion of the aggregation time.