If the two table is associated with a field that is not set in the table structure, it cannot be used even if the index is set.
For details, please refer to:
Https://yq.aliyun.com/articles/69138?spm=5176.100239.bloglist.185.xQpesw
For MySQL explain, the Key_len field is calculated as follows:
VARCHR (10) Variable length field and allow NULL = ten * (character set:utf8=3,gbk=2,latin1=1) +1 (NULL) +2 (variable-length field)
VARCHR (10) Variable-length field and no null = +2 (character set:utf8=3,gbk=2,latin1=1) (variable-length field)
char (10) Fixed field and allow NULL = ten * (character set:utf8=3,gbk=2,latin1=1) +1 (NULL)
char (10) Fixed field and does not allow NULL = ten * (character set:utf8=3,gbk=2,latin1=1)
Detailed reference: http://www.cnblogs.com/gomysql/p/4004244.html
MySQL index length interpretation and a special case of not using indexes