MDEV-21580 adds packed sort keys. They are supported in filesort and the functions it calls.
Unique class shares some functions with filesort, so it should be now almost trivial to change it to use packed sort keys, as well.
Unique class is currently used in
- agg_func(DISTINCT col)
- index-merge stores rowids (these are fixed size so no need to do packing here)
- EITS uses unique