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

2023-06-20,,

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)的相关教程结束。

《利用索引与不用索引区别(profiles).doc》

下载本文的Word格式文档,以方便收藏与打印。