mysql学习(七)-索引学习

常规索引:

            在常用查询的字段上使用常规索引

          创建表时一块创建索引

    create table if not exists carshop(id int not null auto_increment, uid int not null, gid int not null, primay key(id), index cuid(uid), key cgid(gid));

    create table if not exists carshop(id int not null auto_increment, uid int not null, gid int not null, primary key(id), index carindex(uid, gid));

    单独创建索引

    create index carindex on carshop(uid, gid);

    删除索引

    drop index carindex on carshop;

 

全文索引:只能用在char varchar text字符类型

posted @ 2013-09-30 11:59  激扬飞雪  阅读(162)  评论(0编辑  收藏  举报