3
Collation                | Charset  | Id  | Default | Compiled | Sortlen |
+--------------------------+----------+-----+---------+----------+---------+
| utf8_general_ci          | utf8     |  33 | Yes     | Yes      |       1 |
| utf8_bin                 | utf8     |  83 |         | Yes      |       1 |
| utf8_unicode_ci          | utf8     | 192 |         | Yes      |       8 |

What's sortlen of mysql collation? What's the difference between sortlen of utf8_unicode_ci and utf8_general_ci?

3
  • I did a search and all I could come up with was Sortlen is related to the amount of memory required to sort strings expressed in the character set. - what exactly related to means is unclear - I've looked at several pages and no further detail was forthcoming!
    – Vérace
    Dec 11, 2020 at 15:38
  • Stack Exchange (finally) has table markdown now. If you change your + into | then your table will be formatted as an actual table in your post.
    – Tyler N
    Dec 11, 2020 at 16:01
  • After 20 years of using MySQL, I have found no end-user use for Sortlen. Ignore it.
    – Rick James
    Dec 11, 2020 at 17:15

1 Answer 1

2

The field Sortlen indicates the bytes needed when collating data:

So the collation is used to sort and compare the strings presented, but as the complexity of the rules for a language increases, you need space to sort the string or compare, because you have to store some information on the way.

Rick James is right you can see them,. because they are used on inside, when sorting or comparing and the number of bytes for sorting are set when the rules are made for a specific.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.