欢迎来到天天文库
浏览记录
ID:35494392
大小:59.04 KB
页数:8页
时间:2019-03-25
《[调整abap程序的性能]》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、如何调整ABAP程序的性能1、使用where语句不推荐Select*fromzflight.Check:zflight-airln='LF'andzflight-fligh=,BW222,.Endselect.推荐Select*fromzflightwhereairIn='LF'andfligh=<222,.Endselect.2、使用聚合函数不推荐Maxnu=0.Select*fromzflightwhereairIn='LF'andentry='IN'.Checkzflight-fligh>maxnu.Maxnu=zflight-fligh.Endselect・推
2、荐whereairIn二'LFandentrSelectmax(fligh)fromzflightintomaxnu3、使用视图代替基木表査询不推荐Select*fromzentrywhereentrylike4IN%Selectsingle*fromzflightwherecntry=zentry・entryandairIn=TF.Endselect.推荐Select*fromzcnflwhereentrylike'IN%'andairIn='LF.Endselect.4、使用INTOtable代替selectendselect不推荐Refresh:int_fli
3、gh.Select*fromzflightintoint_fligh.Appendint_fligh.Clearint_fligh.Endselect・推荐Refresh:int_fligh.Select*fromzflightintotableint_fligh.5、使川批量修改内表代替逐行修改不推荐Loopatint_fligh.Ifint_fligh-flagisinitial.Int_fligh-flag='X'.Endif.Modifyint_fligh.Endloop.推荐Int_fligh-flag='X'.Modifyint_flightranspor
4、tingflagwhereflagisinitial.6、使用二分法查询,提高查询内表数据速度不推荐Readtableint_flighwithkeyairIn='LF'.推荐Readtableint_flighwithkeyairIn="LFbinarysearch.7、两个内表添加使用批量增加代替逐行不推荐Loopatint_fligh1.Appendint_fligh1toint_fligh2.Endloop.推荐Appendlinesofint_fligh1toint_fligh2・8^使用tablebufferingUseofbufferedtablesis
5、recommendedtoimprovetheperformsneeconsiderably.ThebufferisbypassedwhileusingthefollowingstatementsSelectdistinctSelect…forupdateOrderby,groupby,havingclauseJoinsUsetheBypassbufferadditiontotheselectclauseinordertoexplicitlybypassthebufferwhileselectingthedata・9.使用FORALLEntries不推荐Loopati
6、nt_cntry.Selectsingle*fromzflighintoint_flighwhereentry=int_cntry・cntry.Appendint_fligh.Endloop・推荐Select*fromzflighappendingtableint_flighForallentriesinint_cntryWhereentry=int_cntry・cntry.10、正确地使用where语句,使查询能使用索引Whenabasetablehasmultipleindices,thewhereclauseshouldbeintheorderoftheinde
7、x,eitheraprimaryorasecondaryindexTochooseanindex,theoptimizerchecksthefieldnamesspecifiedinthewhereclauseandthenusesanindexthathasthesameorderofthefields.OnemoretipisthatifatablebeginswithMANDT,whileanindexdoesnot,thereisahighpossibilitythattheoptimizermightnotusethatindex・11、正
此文档下载收益归作者所有