用index加索引,再用show create table命令查看得到的是key,不是index了,这原因是什么。
这两者之间有什么区别没哦?
附上代码:
create table tbl01(
id int(10),
key key_id (id)
);
show create table tbl01;
CREATE TABLE tbl01
(id
int(10) DEFAULT NULL,
KEY key_id
(id
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
create table tbl02(
id int(10),
index key_id (id)
);
show create table tbl02;
CREATE TABLE tbl02
(id
int(10) DEFAULT NULL,
KEY key_id
(id
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
另外,在power designer中设置字段上有keys和indexes两个选项,这是有什么区别哦?
刚入行,望指教