我正在使用一个用于跟踪文档的Sql Server数据库,并且我正在尝试根据存储在indexTables中的四个值查找重复文档。到目前为止我所拥有的速度非常慢。有没有办法加快速度呢?
select d.ID, d2.ID
from DOCUMENTS d
inner join IndexTable1 itm on d.ID = itm.ID
inner join IndexTable2 pd on d.ID = pd.ID
inner join IndexTable3 amt on d.ID = amt.ID
inner join IndexTable4 acct on d.ID = acct.ID
inner join DOCUMENTS d2 on d.ID <> d2.ID
inner join IndexTable06 itm2 on d2.ID = itm2.ID and itm.VALUE=itm2.VALUE
inner join IndexTable07 pd2 on d2.ID = pd2.ID and pd2.VALUE = pd.VALUE
inner join IndexTable03 amt2 on d2.ID = amt2.ID and amt.VALUE = amt2.VALUE
inner join IndexTable13 acct2 on d2.ID = acct2.ID and acct.VALUE = acct2.VALUE
更多信息: 运行“显示估计执行计划”显示,在IndexTable2(37%)和IndexTable3(35%)上进行聚集索引搜索的最大命中。