嵌套的子查询性能

时间:2013-10-23 01:47:17

标签: sql query-performance

寻找以下SQL的替代方案。解释结果表明,表1正在通过表空间扫描大约1000万条记录。表2有20条记录。 两个表都在所有5列上都有索引。

DELETE FROM         TABLE1 
      WHERE ( T.C1 ,T.C2 ,T.C3
             ,T.C4 ,T.C5
            ) = ANY      (SELECT  D.C1 ,D.C2 ,D.C3
             ,D.C4 ,D.C5
           FROM         TABLE2 D
             WHERE   D.C1    = T.C1
              AND    D.C2      = T.C2
              AND    D.C3      = T.C3
              AND    D.C4     = T.C4
              AND    D.C5      = T.C5
           )
          QUERYNO 1
       ;

有什么想法?

0 个答案:

没有答案