The key_len column indicates the length of the key that MySQL decided to use. The length is NULL if the key column says NULL. Note that the value of key_len enables you to determine how many parts of a multiple-part key MySQL actually uses.
数据库版本及数据表结构如下
mysql> select version(); +------------+ | version() | +------------+ | 5.6.10-log | +------------+ 1 row in set mysql> show create table usercasinoresult_11; +---------------------+-------------------------------------------------+ | Table | Create Table | +---------------------+-------------------------------------------------+ | usercasinoresult_11 | CREATE TABLE `usercasinoresult_11` ( `CasinoID` varchar(64) NOT NULL, `UserID` bigint(20) NOT NULL DEFAULT '0', `NickName` varchar(45) NOT NULL, `LastUpdateTime` datetime NOT NULL, `GameSpecified` varchar(500) DEFAULT NULL, PRIMARY KEY (`CasinoID`,`UserID`), KEY `IX_UserID_LastUpdateTime` (`UserID`,`LastUpdateTime`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 | +---------------------+-------------------------------------------------+ 1 row in set