两张表tabelA(id,LastUpdate,c1),其中在日期LastUpdate上建立desc索引IX_tableA_LastUpdate,在数字值c1上也建有索引两条SQL:
SQL1:select top 1000 * from tableA with(index(IX_tableA_LastUpdate))
SQL2:select top 1000 * from tableA order by LastUpdate desc
这两个是等效的吗?从试验结果看是一致的但是增加条件后
SQL1:select top 1000 * from tableA with(index(IX_tableA_LastUpdate)) where c1=1
SQL2:select top 1000 * from tableA where c1=1 order by LastUpdate desc
两个查询结果就大部分不一致了SQL1的内容就不是按照时间取的最后值了,我想可能的结果是因为改进过的SQL1除了IX_tableA_LastUpdate起作用以外,c1的索引起了干扰效果导致的请问有什么办法解决这个问题吗?