CREATE TABLE military_umc_organ
(id
bigint(20) NOT NULL AUTO_INCREMENT,umc_organ_code
varchar(20) NOT NULL,mt_organ_code
varchar(10) NOT NULL,create_time
datetime DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id
),
KEY organ_id
(umc_organ_code
) USING BTREE,
KEY organ_code
(mt_organ_code
) USING BTREE
) ENGINE=InnoDB AUTO_INCREMENT=3823 DEFAULT CHARSET=utf8mb4;
建表语句中 KEY organ_code
(mt_organ_code
) USING BTREE,USING BTREE是加索引,KEY organ_code
(mt_organ_code
) 代表什么意思?
https://blog.csdn.net/kiulang/article/details/79424359
organ_code代表索引名字,mt_organ_code是索引的字段。不过阿里推荐的索引命名是
pk_表示primary_key,不过mysql不允许主键设置别的名字。uk_表示unique_key,唯一索引,idx_表示index普通索引