select col1, col2 from table1 where col1 in (select table2.col1 from table2) and col2 = 'ABC' ;
在table1中,索引在col2上可用,在col1上没有索引可用。如果删除"in (从table2中选择table2.col1 )“条件,则查询的行为方式与索引查询所需
我的应用程序从SQL Server中的表中访问数据。考虑表名为PurchaseDetail和其他一些列。select查询具有以下where子句。1. name - name只有10000个值。2. createdDateTimeselect *where name in (~2000 name)
and createdDateTime我尝试使用这些推荐的索引。性