Not recommended:-
Refresh : itab_cust_t
select *
from /bi0/tcustomer
into itab_cust_t
append itab_cust_t.
clear itab_cust_t.
Recommended:-
Refresh : itab_cust_t
select *
from /bi0/tcustomer
into table itab_cust_t
在对内表进行查找时,使用二分查找方法;
Not Recommended
Read table itab_cust_t with key soursystem=’I2P’.
Recommended
Read table itab_cust_t with key soursystem=’I2P’ binary search.
在操作两个内表时,尽量使用append插入行,当然这两个内表的结构是要相同的;
Not Recommended
Loop at itab_cust_t.
Append itab_cust_t to itab_cust_t1.
EndLoop.
Recommended
Append lines of itab_cust_t to itab_cust_t1.
使用表缓存,当如下情况时,表缓存会被忽略:
1, select distinct
2, select ... for update
3, Order by, group by, having clause
4, Joins
使用FOR ALL Entries,系统会自动创建outer join,相应缺点有:
1,雷同数据会被自动清除掉,如果不希望这样,应该在select中加入唯一key值查询;
2,如果基于FOR ALL Entries查询的表是空的,所有行都会被插入目标表;
3,如果用于FOR ALL Entries的表记录很大,这种情况下性能是下降而不是提升的。
Not Recommended
Loop at itab_cust_t.
Select single * from /bi0/mcustomer into itab_cust_m
Where soursystem= itab_cust_t-soursystem.
Append itab_cust_m.
EndLoop.
Recommended:-
Select * from /bi0/mcustomer appending table itab_cust_m
For all entries in itab_cust_t
Where soursystem= itab_cust_t-soursystem.
使用合理的where语句。当一个表有多个索引时,where语句应该以索引顺序书写;