mysql searches the index and finds the key_name of id_2. What index is this? ? SHOW INDEX FROM spm_works, the result is as shown below:
业精于勤,荒于嬉;行成于思,毁于随。
You should be the ordinary index you created. Show the creation statement of the spm_works table: show create table spm_works; See if the id_2 index line is created.
id_2 This is the name of the index built on the id field. Obviously this is a normal index and is not unique.
You should be the ordinary index you created. Show the creation statement of the spm_works table: show create table spm_works; See if the id_2 index line is created.
id_2 This is the name of the index built on the id field. Obviously this is a normal index and is not unique.