全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
abap 程序优化点滴 1、使用where语句 不推荐Select * from zflight.Check : zflight-airln = LF and zflight-fligh = BW222.Endselect.推荐Select * from zflight where airln = LF and fligh = 222.Endselect.2、使用聚合函数不推荐Maxnu = 0.Select * from zflight where airln = LF and cntry = IN.Check zflight-fligh maxnu.Maxnu = zflight-fligh.Endselect.推荐Select max( fligh ) from zflight into maxnu where airln = LF and cntry = IN.3、使用视图代替基本表查询不推荐Select * from zcntry where cntry like IN%.Select single * from zflight where cntry = zcntry-cntry and airln = LF.Endselect.推荐Select * from zcnfl where cntry like IN% and airln = LF.Endselect.4、使用INTO table 代替select endselect不推荐Refresh: int_fligh.Select * from zflight into int_fligh.Append int_fligh. Clear int_fligh.Endselect.推荐Refresh: int_fligh.Select * from zflight into table int_fligh.5、使用批量修改内表代替逐行修改不推荐Loop at int_fligh.If int_fligh-flag is initial.Int_fligh-flag = X.Endif.Modify int_fligh.Endloop.推荐Int_fligh-flag = X.Modify int_fligh transporting flag where flag is initial.6、使用二分法查询,提高查询内表数据速度不推荐Read table int_fligh with key airln = LF.推荐Read table int_fligh with key airln = LF binary search.7、两个内表添加使用批量增加代替逐行不推荐Loop at int_fligh1.Append int_fligh1 to int_fligh2.Endloop.推荐Append lines of int_fligh1 to int_fligh2.8、使用table bufferingUse of buffered tables is recommended to improve the performance considerably. The buffer is bypassed while using the following statementsSelect distinct Select for update Order by, group by, having clause Joins Use the Bypass buffer addition to the select clause in order to explicitly bypass the buffer while selecting the data.9、 使用FOR ALL Entries不推荐Loop at int_cntry. Select single * from zfligh into int_fligh where cntry = int_cntry-cntry. Append int_fligh. Endloop.推荐Select * from zfligh appending table int_flighFor all entries in int_cntry Where cntry = int_cntry-cntry.10、正确地使用where语句,使查询能使用索引When a base table has multiple indices, the where clause should be in the order of the index, either a primary or a secondary indexTo choose an index, the optimizer checks the field names specified in the where clause and then uses an index that has the same order of the fields. One more tip is that if a table begins with MANDT, while an index does not, there is a high possibility that the optimizer might not use that index.11、正确地使用MOVE语句Instead of using the move-corresponding clause it is advisable to use the move statement instead. Attempt should be made to move entire internal table headers in a single shot, rather than moving the fields one by one.12、正确地使用inner joinLet us take an example of 2 tables, zairln and zflight. The table zairln has the field airln, which is the airline code and the field lnnam, which is the name of the airline. The table zflight has the field airln, the airline code and other fields which hold the details of the flights that an airline operates.Since these 2 tables a re logically joined by the airln field, it is advisable to use the inner join.Select aairln alnnam bfligh bcntry into table int_airdetFrom zairln as a inner join zflight as b on aairln = bairln.In order to restrict the data as per the se
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 胆囊的课件教学课件
- 医疗数据安全事件应急处置中的患者权益保障机制
- 医疗数据安全与医疗物联网设备数据安全防护策略
- 医疗数据孤岛破解:区块链协同治理模式
- 山西省2026届数学高三第一学期期末质量检测模拟试题含解析
- 胃占位CT表现课件
- 9-专题十二 世界多极化与经济全球化 十年真题
- 医疗数据区块链安全防护的关键问题
- 25:2024届江苏省苏北七市(南通三模) 学生版答案
- 山东省东营市实验中学2026届高一生物第一学期期末监测试题含解析
- 球团化验知识培训课件
- PADI初级开放水域潜水员OW理论模拟考试A卷
- 2025年及未来5年中国硬碳负极材料行业市场全景监测及投资策略研究报告
- 江苏省南京市秦淮区2024-2025学年七年级上学期期末考试英语试题(含答案解析)
- GB/T 4995-2025平托盘性能要求和试验选择
- 2025年妇女发展基金面试模拟题集
- 2025学年人教版小学三年级数学上册期末试卷(含答案解析)
- GB/T 27612.2-2025农业灌溉设备喷头第2部分:结构和运行要求
- 维修人员薪酬管理制度
- 鼻出血教学课件
- 人教版初中英语单词大全
评论
0/150
提交评论