zoukankan      html  css  js  c++  java
  • SAP ABAP 性能优化技巧 — 使用 “for all entries”

    在select语句后面的where附加项中可以使用左关联,这会极大的提高程序速度,但同时也有一些局限,如下:

    1. 重复项会被从结果数据集中自动删除,因此要注意在select语句中需要给出详细的唯一关键字组合。
    2. 如果 For All Entries IN 字段修饰的内表是空表的话,源表的所有行都会被选入目标表中。因此在使用前一定要首先检查第一个表是否为空,这一点很重要,否则会有performance问题。
    3. 如果 For All Entries IN 字段修饰的内表很大的话,程序速度反而会减慢,而不是加快。因此应该尽量使该表的数据量控制在一个适当的大小。

    不推荐使用:

    Loop at int_cntry.

    Select single * from zfligh into int_fligh

    where cntry = int_cntry-cntry.

    Append int_fligh.

    Endloop.

    推荐使用:

    IF NOT int_cntry[] IS INITIAL.

      Select * from zfligh appending table int_fligh

    For all entries in int_cntry

    Where cntry = int_cntry-cntry.

    ENDIF.

  • 相关阅读:
    java前端学习步骤
    安装Sublime Text 3插件的方法(转自Rising的博文)
    LibSVM学习详细说明
    class 2-3 小项目练习
    class 2-2 小项目练习
    class 2-1 小项目练习
    class 1-1 python开发环境配置
    Class
    class 10 文件和异常
    class
  • 原文地址:https://www.cnblogs.com/levin/p/1537858.html
Copyright © 2011-2022 走看看