加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

sql – 是否有必要考虑删除现有索引,因为它是推荐索引的前缀

发布时间:2020-12-12 07:28:18 所属栏目:MsSql教程 来源:网络整理
导读:Oracle SQL Developer v3的SQL Tuning Advisor为我的查询建议如下: Consider running the Access Advisor to improve the physical schema design or creating the recommended index. If you choose to create the recommended index,consider dropping the
Oracle SQL Developer v3的SQL Tuning Advisor为我的查询建议如下:

Consider running the Access Advisor to improve the physical schema
design
or creating the recommended index. If you choose to create the
recommended index,consider dropping the index

SCHEMANAME“.”INDEXNAME” (on “COLUMN1”) because it is a prefix of the
recommended index.

在SCHEMANAME.TABLENAME上创建索引SCHEMANAME.NEW_INDEXNAME(“COLUMN1”,“COLUMN2”);

不做粗体建议有什么害处吗?问题是它建议丢弃的现有索引被其他程序使用.我不认为这些因素会相互“伤害”,是否有任何缺点让两个索引与它们将占用的磁盘空间分开,并且在插入/更新时性能下降不明显?

解决方法

因此,假设OLD INDEX在[Column1]上并且RECOMMENDED INDEX在[Column1] [Column2]上,则建议的索引也可用于现有查询.

简而言之:正如您所说,删除OLD INDEX会提高插入/更新的性能,也不会降低在使用OLD INDEX的查询上搜索过扫描的能力.推荐索引仍然允许查找[Column1]值以及[Column1] [Column2]值.

因此,除了更新/插入的性能下降和额外的存储开销之外没有任何损害,但是维护这两个索引也没有任何好处.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读