建立索引

優化MySQL查詢的其中一個方法是添加索引

--添加索引的語句如下:
create index **index_name** on **table_name** (**column_name**);
--刪(月弓)(刀字邊用打弓)除索引:
drop index index_name on table_name;

例子: create index first_name_index on employees (first_name);
在添加索引後, 查詢相同語句的速度明顯提升。

猜你喜欢

转载自blog.csdn.net/vincentgoodturtle/article/details/91616921