Quantcast
Channel: SCN : Popular Discussions - ABAP和Java开发 (ABAP & Java Development)
Viewing all articles
Browse latest Browse all 4604

语句FOR ALL ENTRIES IN 的使用

$
0
0
SELECT B~VGBEL B~VGPOS B~LFIMG A~KOSTA       INTO CORRESPONDING FIELDS OF TABLE IT_TEMP3    FROM VBUP AS A       JOIN LIPS AS B        ON  A~VBELN = B~VBELN      AND A~POSNR = B~POSNR  WHERE A~KOSTA <> 'C'.

 

     

SELECT B~VBELN B~POSNR B~VGBEL B~VGPOS B~LFIMG A~KOSTA        INTO CORRESPONDING FIELDS OF TABLE IT_TEMP3       FROM VBUP AS A       JOIN LIPS AS B         ON A~VBELN = B~VBELN        AND A~POSNR = B~POSNR       FOR ALL ENTRIES IN ITAB       WHERE B~VGBEL = ITAB-VBELN         AND B~VGPOS = ITAB-POSNR         AND A~KOSTA <> 'C'         .

以上两段代码运行时间差非常多,在第一段中只需要4秒左右,而第二段中用FOR ALL ENTRIES IN却需要近70秒。对于FOR ALL ENTRIES IN的时候,WHERE子句中的条件如果不是索引会是更慢吗?还是其他原因,因为在第一段中即使全部数据取出来也只有4535条记录。


Viewing all articles
Browse latest Browse all 4604

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>