【发布时间】:2010-04-21 12:41:04
【问题描述】:
给定一个表 (id, col1, col2),创建以下索引是否有意义:
Index1 (col1) 不唯一
Index2 (col1, col2) 不唯一
我面临着一个充满这些的遗留数据库。
我可以安全地删除 Index1 吗? SQL Server 和 Oracle 需要 Anwser。
【问题讨论】:
标签: sql-server indexing
给定一个表 (id, col1, col2),创建以下索引是否有意义:
Index1 (col1) 不唯一
Index2 (col1, col2) 不唯一
我面临着一个充满这些的遗留数据库。
我可以安全地删除 Index1 吗? SQL Server 和 Oracle 需要 Anwser。
【问题讨论】:
标签: sql-server indexing
是的,你可以删除索引1,如果你有Index2 (col1, col2),则不需要Index1 (col1),删除Index1 (col1)
如果查询只需要Index1 (col1),那么Index2 (col1, col2) 的使用将由于额外的列而产生轻微的额外开销,这对于维护和维护一个完整的额外索引的费用来说是最小的。
也就是说,如果这个旧数据库运行良好,为什么要进行任何更改?
【讨论】: