首页 > 其他 > 详细

利用索引与不用索引区别(profiles)

时间:2018-09-02 10:50:27      阅读:196      评论:0      收藏:0      [点我收藏+]

1、定义
  对数据库表的一列或多列的值进行排序的一种结构(Btree方式)=(相当于二分查找法)
2、优点
  加快数据检索速度
3、缺点
  1、占用物理存储空间
  2、当对表中数据更新时,索引需要动态维护,降低数据维护速度
4、索引示例
  1、开启运行时间检测 :set profiling=1;
  2、执行查询语句
  select name from t1 where name="lucy99999";
3、查看执行时间
  show profiles;
4、在name字段创建索引
  create index name on t1(name);
5、再执行查询语句
  select name from t1 where name="lucy88888";
6、查看执行时间
  show profiles;

利用索引与不用索引区别(profiles)

原文:https://www.cnblogs.com/zengsf/p/9572900.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!