Vous êtes sur la page 1sur 14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN
GettingStarted Newsletters

Hi,Guest

LogOn

JoinUs

Store

SearchtheCommunity

Products

Services&Support

AboutSCN

Downloads

Industries

Training&Education

Partnership

DeveloperCenter

Activity

LinesofBusiness

UniversityAlliances

Events&Webinars

Innovation

Browse

Communications

Actions

ABAPforSAPHANA

ABAPonHANAfromanalysistooptimization
PostedbyManfredHoffmanninABAPforSAPHANAon05Jun201316:11:20
Share

10

Tweet

Like

Part1:Introduction

ThisdocumentdescribesrelevantstepstomaximizetheeffectofABAPperformancetuningofcustomcodingforan
SAPSystemrunningonHANADB.
WewillfocusontoolsandguidelinesdeliveredbySAP.

Wewillstartwithaprocedurehowtofindcandidates(reports,transactions)thatshowasignificantpotentialfor
performanceimprovementsoptimizingABAPcoding.

Ineachsectionofthisdocumentwewilldiscussdifferentaspectsoftheoptimizationstartingwiththeidentificationof
potentialcandidatesandendingwithtipsandtricksfromrealliveprojects.

Thesectionsare

ThegoldenrulesFiveperformanceguidelinesforABAPdatabaseoperations
HowtofindcandidatesUseST03N
ThetoolboxCodeInspectorandABAPTrace
OptimizingABAPcodeUseFORALLENTRIESandJOINs
TipsandtricksSomehintsbasedonourexperience
CodepushdownStoredproceduresandHANAArtifacts

Eachofthesectioncanbereadindividually,buttogetmostoutofthisdocumentitisrecommendedtoreadthemin
sequence.

Outlook

Inthefollowingsectionwewilldiscusstheclassicalprogrammingparadigmsandtheirmeaningforprogrammingon
SAPHANA.

Part2:TheGoldenRules

TherearefiveperformanceguidelinesforABAPdatabaseoperations.DespiteallchangesintheDatabasetechnology
thatcomewithSAPHANA,theseclassicprogrammingparadigmsremainvalid.

Withthisinmind,wewillputoneKeymessageontopofthischapter

Allclassicalperformancerecommendationsarestillvalid
asgeneralguidelines
OnSAPHANAsomeoftherecommendationshaveahigher
performanceandsomeoftheclassicaldesignpatternareofleastimportance

Letushavealookattherulesandtheirmeaningasaruleofthumb

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

1/14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN

WhatdoesthismeanforourABAPcode?WewillknowlookateachrulewhatwhattheymeaninthecontextofSAP
HANA

Rule1:Keeptheresultsetsmall

Rule2:Minimizeamountoftransferreddata

Rule3:Avoidemanysmallrequestandselectingnotneededcolumns

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

2/14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN

Rule4:Defineanduseappropriatesecondaryindexes

Rule5:Keepunnecessaryloadawayfromthedatabase

Outlook

InthenextsectionwillwilluseTransactionST03N(WorkloadAnalysis)toanalysetheworkloadonoursystemandto
identifyreportsandtransactions,thatcanbenefitfromcodecangesandgainperformancefromSAPHANA.

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

3/14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN

Part3:Howtofindreports,programsandtransactions
optimization

Thereareseveralwaystoidentifyreportsandtransactionsthatwillbenefitfromcoderework.

Lookatreportsandtransactionsthatarenamedbyusers
ReviewtheEWAreport
Followtheproceduredescribedbelow

WewillnowdescribehowtouseTransactionST03Ntoidentifyreportsandtransactionsthatwillpotentiallybenefit
fromSAPHANA.

3.1ST03NWorkloadAnalysis

WithourapproachwewillgainmostfromSAPHANAifwefocusonABAPprogramswithhighDBload.Thetoolof
choiceistransactionST03N(WorkloadAnalysis).
Howtoproceed?Inthefollowingwewillshowbriefstepbystepprocedure

Step1:
CalltransactionST03N

SwitchtoExpertmodefirst.
IntheWorkloadtreechooseTotal
Serversandselectthelastfullmonth.
IntheAnalysisViewschoosetheTransactionProfilefolderandchooseStandard

Step2:
GototabAllDataanddownloadthelisttoExcel.
Youcannowmanipulatethedata,e.g.applyfilterandhideordeletenotcolumnsyouarenotinterested
in.
Ifyouremovecolumnsfromthelist,itisrecommendedtokeepthefollowingones:

Step3:

Nowwecancheckwherethe
runtimecomesfrom.
CreatetwonewcolumsinyourExceltocalculatepercentageofDBtimeand
percentageofchangetime.Usethisformula

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

4/14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN

Toreducethe
numberoflinesintheresultaddafilteronTrans/Rep.andapplyatextfilterwiththerestrictiontoallnamesin
customernamespace.Thiswill
limityourselectiontoalltransactionandreportsthatcanbechangedbyaprogrammerwithouttheneedto
modifySAPstandardcode.

SAPwilltakecareofitsowncodeandprovidechangeswithpatchesandnotes.Certainscenarioswillbenefit
fromSAPStandardAcceleratorsonHANA(SideCar,e.g.CO/PAAccelerator).

Sortthelistby

1. PercentageDBtime(ascending)and
2. PercentageChangetime(ascending).

ReportswillbenefitfromHANAifDBtimeismainlycausedby

sequentialreads(>columnTotalSeq.Readtime(s)orTSeq.ReadTime)andthe
timeforchangesisratherlow(>columnTotalTimeforLogicalDBChanges(s)orTChanges).

Toidentifythesereportsrestricttheresultlisttoreports/transactionswith

DBtimehigh(>70%)and
changetimelow(<=1%)

Youcandothisifyouapplyafilteronbothcolumnsusingthevaluesgivenabove.

Finally,theresulttableshouldlooklikethis

InourexampleabovewehavemarkedtheselinesthatfulfilourrequirementonDBtimeandChangetimein
yellow.

Nowyouhavecreatedalistofcandidatesforcodeoptimization.Inthenextsessionswewillhaveamore
detailedlookonABAPprogramsusingSAPtoolstoidentifyareaswithpotential,thepossiblecodechangesand
theresultofthesechanges.

Comingnext

InthenextsectionwewillhavealookatsometoolsfromSAPthatwillhelpuswiththeanalysisofour
ABAPcode.Withthisinformationwecanlaterdochangesandalsoanalyzeprosandconsofourapproach.

Part4:AnalyzeandoptimizeABAPCodestaticcode
analysis

4.1SAPCodeInspector

SAPcodeInspectorisatooldesignedtoperformstaticcodechecks.Forshureitwillnotfindeverything,butyouwill
seeitisafinetooltofindandeleminatecommonmistakes,thatarehiddeninyourcode.Itisespeciallyusefulifyou
startworkingoncodethatwasdesignedandwrittenyearsagoandthereisaneedtofindareasforimprovement
withoutspendingtimeforadetailedanalysis.

Howdoesitwork?Wewillguideyouthroughthetoolwithoutgoingtoallfactsandfeaturesandwillconcentrateuson
thechecksthatwillhelpusonourjourneytowardsperformantABAPcoderunningonSAPHANA.

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

5/14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN

NowstartSAPCodeInspectorandcreateanewinspection.

EntertransactioncodeSCI(or/nSCI)andthiswillleadyoutotheinitialscreen

WewillrunanewInspection,so
enteranameandproceed.

Nowchoosetheobjectyouareinterestedin.Wewillanalyzeasingleprogram,soenterthemandatorydata.
Youcanalsocheckmultipleobjects,eventhecontensofatransportrequest.

Nowgrabeitherapredefinedvariantorchoosefromthelistbelow.
Inthefirststepwewillusethefourtestdeliveredwith7.40toidentifyproblematicSELECTstatements.

Let'shaveabrief
lookatthetestwe
haveflagged

Search
problematic
SELECT*statement
>Thistestwillfindstatementsselectingallfields.Thiscanbereplacedwithafieldlist
SearchSELECT...FORALLENTRIESclausestobetransformed
>Gofurtherandfindout,ifthiscanbereplacedusinga(LEFTOUTER)JOIN
SearchSELECTstatementwithDELETEstatement
>Trytoavoiddeletingsinglelines(withinaloo),transforthistoanarrayoperation
SearchSELECTsinloopsacrossmodularizationunits
>ThiswillhelpyoutofindnestedSELECTshiddeninmodularizationunigs,e.g.inFORMsorROUTINEs

Nowruntheinspectionandtakealookattheresultlist.Inourexample,SAPCodeInspectorhasreturnedtwoareasof
concern:

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

6/14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN

Selectalineanddoubleclickonittoseethedetails

Againchooseoneofthemessagestoseethedetails

InourcasethesystemdetectsaSELECT*statement,andfromtheanalysislessthan10%ofallfieldsretreivedare
used.Asthisanalysisisdonebyanalgorithm,itisalwayswisetoreviewtheanalysisanddecidebasedonacode
analysis,wichfieldshouldbeinthefieldlist.

Let'sgoon,andjumptotheaffectedlinesofcode.Youcandothisdirectlyfromtheresult

Afterthisisreviewdandifpossiblefixedreturntotheresultoftheanalysisandgotothesecondfinding.Herewe
areinformedofanestedSELECT.

Letushavealookatthenew
checksaddedtoSAPCode
Inspectorwithfocuson
efficientABAPprogramming
onSAPHANA.
IntwosectionsSAPhas
addednewchecks
1.SectionPerformance
Checkshasfournewchecks
1. SearchproblematicSELECT
*statements
2. SearchSELECT..FORALLENTRIESclausestobetransformed
3. SearchSELECTstatementwithDELETEstatement
4. SearchSELECTsinloopsacrossmodularizationunits

2.SectionRobustProgramminghastwonewchecks
1. SearchproblematicSELECT*statements
2. SearchproblematicstatementsforunsortedresultsofSELECTorOPENCURSORstatements

Whatdoesthismeanindetail,andwhatdoesthecheckforme?Theinlinedocumentationgivesusmoreinformation:

.............................................................................................................................................................

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

7/14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN

PerformanceCheck1.1:SearchproblematicSELECT*statements
Searchfor
SELECT*FROMdbtabstatementswhichshouldbetransformedinto SELECTcomp1comp2...
FROMdbtab.

Thischecksearchesfor SELECT*FROMdbtabstatementswherelessthanaspecifiedpercentageofthe
fieldsareeffectivelyused.Thedefaultvalueforthepercentageis20percent.Iflessthan20percentofthe
fieldsareuseditismoreadequatetoselectonlytheusedfields.
Ifsinglesubroutinesarespecifiedbythecheckset,onlythecodingintheseroutinesischecked.
Checkparameters:
Minimumtablesizecategory:withthisparameteryoucanrestrictthesearchon SELECTstatements
thataccessdatabasetableswithasizecategorythatisequalorlargerthantheparameter.Thesize
categoryismaintainedinthetechnicalsettingsofadatabasetableintheABAPdictionary(SE11).
Minimumnumberoftablefields:withthisparameteryoucanrestrictthesearchon SELECT
statementsthataccessdatabasetableswithequalormorecolumnsthantheparameter.
Onlysearchforthesetables:hereitispossibletorestrictthesearchtoaccessestotheselected
tables.
Percentageoffields:Percentageofusedtablefieldstobeconsideredas"few"
Evaluationlevel:Theevaluationprocessstartatthetoplevelproceduresofacompilationunitand
followsthecallstootherprocedures.Withthisparameteryoucanspecifythemaximalevaluation
depth.
Excludebufferedtables:Normallyaccessestobufferedtablesareanalyzedaswell.Withthis
parameteryoucanexcludeit.
Nottobetransformedselects:Displayalsoinformationabout SELECTstatementswhichshouldnot
betransformed.
Displaydetailinformation:Ifyouswitchonthisparameteryougetverydetailedinformationaboutthe
accesstotheresultoftheselect*statementsandtheevaluationprocess.
EFFORTParameters
EFFORTforoneassignment
EFFORTforonecolumnaccess

Thecheckdeliversthefollowingresultmessages:
FEWSELECTStatementcanbetransformed,becauselessthanthespecifiedpercentageoffieldsis
used.
MANYSELECTStatementshouldnotbetransformed,becausemorethanthespecifiedpercentageof
fieldsisused.
EXISTSSELECTStatementcanbetransformedveryeasily,becauseitisusedjustforanexistence
check.Theworkareaoranyofitscomponentsarenotused.
UNCLEARThesituationfortheselectstatementisunclearbecauseofoneoftworeasons:
TheresultoftheSELECTstatementcannotbeanalyzedfurtheron
Theevaluationwasabortedbecausetheevaluationlevelhasbeenexceeded.

Ifyouhaveswitchedontogetdetailinformation,therearetheadditionalmessages:
SELECTASELECT*statementhasbeenfound,
COMPAcomponentoftheresultofaSELECT*statementisused.
ALLThecompleteresultofaSELECT*statementisusedbythecurrentstatement.
NOEVALThecurrentstateusestheresultSELECT*andhasnotbeenevaluated
LEVELTheevaluationhasbeenabortedatthespecifiedprocedure.

Thechecksdeliversthefollowingtestresultparameters
SEVERITYTheseverityisthenumberofcolumnsofthedatabasetablewhicharereadbutnotused
EFFORTTheeffortiscomputedviathefollowingformula:

....................................................................................................................................................................................................

PerformanceCheck1.2:SearchSELECT..FORALLENTRIESclausestobe
transformed
Searchfor

SELECT...FORALLENTRIESstatementswhichcanbejoinedwithotherSELECTstatements

Thischecksearchesfor SELECT...FORALLENTRIESwheretheinputfortheforallentriestableisthe
resultofanotherSELECTstatement.Inthiscasethetwostatementscanbejoinedintoonestatementwith

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

8/14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN

animprovedperformance.
Thetwo SELECTstatementscanbeindifferentsubroutines.
Ifsinglesubroutinesarespecifiedbythecheckset,onlythecodingintheseroutinesisanalyzed.
Bufferedtables,exceptthosewithsinglerecordbuffering,areexcludedfromtheanalysis.Inthiscasetwo
SELECTstatementsaremoreadequate
Generalparameters:

Minimumtablesizecategory:withthisparameteryoucanrestrictthesearchon SELECTstatements
thataccessdatabasetableswithasizecategorythatisequalorlargerthantheparameter.Thesize
categoryismaintainedinthetechnicalsettingsofadatabasetableintheABAPdictionary(SE11).
Onlysearchforthesetables:hereitispossibletorestrictthesearchtoaccessestotheselected
tables.

Effortparameters:
Effortforoneassignment:withthisparameteryoucandeterminetheeffortforanassignmentofthe
internaltablethatwasfilledbytheselectstatementtoanothertable.

Effortforeachcall:withthisparameteryoucandeterminetheeffortofacallbetweentheselectand
theselectforallentries.

Thecheckdeliversthefollowingresultmessages:
TRANSFORMTheSELECTFORALLstatementcanbejoinedwithanotherSELECTstatement.The
positionofthesecondstatementismentionedinthemessagetext.
LEVELTheevaluationhasbeenabortedatthecurrentprocedure,becausethemaximumevaluation
levelhasbeenreached

Ifyouhaveswitchedontogetdetailinformation,therearetheadditionalmessages:
NoMovesNumberofmovesoftheinternaltable
EffortTheefforttocorrectthisproblem.Itiscalculatedasfollows:
Effort=Effortforeachcall*numberofcalls+Effortforoneassignment*NoMoves+10.
SeverityTheseverityofthisproblemisameasurefortheperformancelossduetothisproblem.
Itisalways1.

.............................................................................................................................................................

PerformanceCheck1.3:SearchSELECTstatementwithDELETEstatement

Searchfor

SELECT..INTOTABLEtabstatementswhicharefollowedbya DELETEstatementforthe
resulttable tab.
Thechecksdeliversthefollowingtestresultparameters
SEVERITYTheseverityisalways1
EFFORTTheeffortisthedistanceinlinesbetweenthe
SELECTandtheDELETEstatement

......................................................................................................................................................................................................................................

PerformanceCheck1.4:SearchforSELECTsinloopsacrossmodularizationunits

Finddatabaseoperationsinnestedloopsacrossmodularizationunits
Thischecksearchesfordatabaseoperationsthatarenestedinsideanykindofloop(e.g.LOOPloop,DO
loop,...).Ifintheloopthereisacalltoamodularizationunit(PERFORM,CALLFUNCTION,CALL
METHOD),thenthiscallistrackedanditwillbeanalyzed,whetherthereisadatabaseoperationinthecalled

unit.Thisway,severallevelsofthecallstackareanalyzed(forruntimereasons,thereisanupperlimitfor
thecallstackdepth).
Whatyoucando:
Ifadatabaseoperationisexecutedinsidealoopforseveralentriesoftheinternaltablethatisprocessed,
pleasecheckwhetheritispossibletoreadorwritetheneededdatabaselineswithonedatabasestatement
instead.Forexample,itcouldbepossibletoreplacethe SELECTinsidethe LOOPwitha SELECT...

FROMdbtabFORALLENTRIESINitab.

GeneralParameters:
Minimumtablesizecategory:withthisparameteryoucanrestrictthesearchonthosedatabase
operationsthataccessdatabasetableswithasizecategorythatisequalorlargerthantheparameter.
ThesizecategoryismaintainedinthetechnicalsettingsofadatabasetableintheABAPdictionary
(SE11).
Callstackdepthforanalysis:thisvaluedetermineshowmanylevelsofthecallstackwillbe
analyzedbelowtheloopstatement.Thedefaultvalueis3,themaximumvalueis10.
Excludebufferedtables:hereitispossibletoexcludeaccessestobufferedtables
Analyzeonlylocalprocedures:hereitispossibletorestricttheevaluationtolocalprocedures,
whichsavesevaluationtime

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

9/14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN
Analyzereadingdboperations:analyzereadingdatabaseoperationsinsidealoop,i.e.SELECT,
OPENCURSOR,FETCH,CLOSE,andtheobsoleteonesREADTABLEdbtabandLOOPATdbtab.
Analyzewritingdboperations:analyzewritingdatabaseoperationsinsidealoop,i.e.DELETE,
INSERT,UPDATE,andMODIFY
AnalyzeEXECSQLstatements:analyzeexecsqlstatementsinsidealoop

EffortParameters(determinetheefforttocorrectaproblematicstatement)
Effortfordbopinloop:withthisparameteryoudeterminetheefforttoremovealoopsurrounding
adatabasestatement.Thedefaultvalueis10.
Effortforeachcall:withthisparameteryoudeterminetheefforttoremovealoopsurroundinga
procedurecallthatcontainsadatabasestatement.Thedefaultvalueis20.
Thecheckdeliversthefollowingresultmessages:

DBREAD_LOCAreadingdatabaseoperationwasfoundinsidealocalloop.
DBREADAreadingdatabaseoperationwasfoundinsideanonlocalloop
DBWRT_LOCAwritingdatabaseoperationwasfoundinsidealocalloop.
DBWRITEAwritingdatabaseoperationwasfoundinsideanonlocalloop
EXEC_LOCAnexecsqloperationwasfoundinsidealocalloop.
EXECAnexecsqloperationwasfoundinsideanonlocalloop
Ifyouhaveswitchedontogetdetailinformation,therearetheadditionalmessages:

TableNameNameofthedatabasetableconcerned
NrLoopsNumberofloopsaroundthedatabaseoperation
NrCallsNumberofprocedurecallsaroundthedatabaseoperation
EffortTheefforttocorrectthisproblem.Itiscalculatedasfollows:
Effort=Effortfordbopinloop+Effortforeachcall*numberofcalls
SeverityTheseverityofthisproblemisameasurefortheperformancelossduetothisproblem.
Itiscalculated:Severity=numberofloops

..............................................................................................................................................................

RobustProgramming2.1:Deepooling/Declustering:SearchSELECTforPool/Cluster
Tablesw/oORDERBY

SearchforSELECTand OPENCURSORstatementsforpoolorclustertableswhereno ORDERBY


clauseisspecified.

Thissituationisproblematicbecausetheorderofthereturneddatabaseentrieschangesifthedatabase
tableismodifiedintoatransparenttable.

Remark:SELECTSINGLEstatementarenotanalyzedsincetheyarenotproblematic.

Remark:IftheresultoftheSELECTstatementismovedintoasortedinternaltable,aspecialmessageis
raised

Messagesofthetestcanbesuppressedviathepseudocomment"#ECCI_NOORDER

.............................................................................................................................................................

RobustProgramming2.2:Searchproblematicstatementsforunsortedresultsof
SELECTorOPENCURSORstatements

Thischecksearchesforthefollowingstatementswheretheinternaltableistheresultofa SELECT
statementwithout ORDERBYclause.Without ORDERBYclauseorothersortingmeasurestheresultofthe
selectstatementmaybeunsorted.Sothestatementsmaynotworkproperly.
Checkparameters:
Onlylocalcalls:Withthisparameteryoucanspecifyifexternalprocedurecallshouldbeanalyzed,
too.
Localanalysisdepth:Theevaluationprocessstartatthetoplevelproceduresofacompilationunit
andfollowsthecallstootherprocedures.Withthisparameteryoucanspecifythemaximalevaluation
depth.
Nonlocalanalysisdepth:Withthisparameteryoucanspecifythemaximalevaluationdepthinto
externalprograms.

Theproblematicstatementsare:

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

10/14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN

Whatyoucando:
Therearetwo(three)possibilities:
1. Addan ORDERBYclausetotheselectstatement
2. Adda SORTstatementfortheinternaltable
3. Ifnoproblemexistsaddthespecifiedpseudocomment

Remark:The SELECTstatementandthecriticalstatementcanbeindifferentsubroutines.
.............................................................................................................................................................

IfyouwanttolearnmoreaboutSAPCodeInspectorfollowtheselinks

http://wiki.sdn.sap.com/wiki/display/ABAP/Code+Inspector

http://www.sap.com/australia/campaign/esnewsletterq4/code_inspector.epx

Comingnext

InthenextsectionwewillcontinuewithwillhavealookatTransaction/nT05(SQLTrace)andhowSQL
TracewillhelpusonourjourneytoperformantABAPonHANAprogramming.

Part5:DBPerformanceAnalysiswithSQLTrace

IfyouexperienceslowtransactionstepismainlycausedbyoneormorelongrunningSQLstatements.Togettothe
rootcauseofthisproblem,doanSQLtraceoftheprocessstep.
ForthisstartST05Aattention:Thetraceisonlyperformedfortheinstanceyouarecurrentlyloggedon,socheck
TransactionSM51/SM51beforeyoustart).CallTransaction/nST05andactivatetheSQLtraceviatheActivateTrace
withFilter.Incaseyouhavetotraceanotheruserandnotyourown,addthisinformationtothispopup.
Remark:Youshouldalwaysusefiltercriteria,to(a)keepthenumberofcollecteddatalowand(b)avoid
unneccessaryloadonthesystem.AndalwaysDeactivateTraceafteryouhavefinishedcollectingtherequireddata.

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

11/14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN

Iftheconfigurationisdone,executethelongrunningstatement.
Assoonasyouhaveperformedthetrace,switchofthetracing(DeactivateTrace)andgotoDisplayTrace.
Chooseyourtracefileanddisplaythesummarizedlist.

Sortthelisbye.g.Timetoseethetimeconsumingstatements.

SelecttheoneyouwanttogetmoreinformationandclickontheSELECTstatementtoseethedetailsofthe
WHEREclause.

ClickontheExplainbuttontoseetheexecutionplanofthestatementasitisexecutedbytheDB.Youcansee,ifand
whichindex/indiceshavebeenused
Inourexamplenoindexwaschoosenandafulltablescanwasdone.

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

12/14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN

Notakeappropriateactionsandfindout,whatcanbedonetooptimizethisstatement.

Comingnext

InthenextsectionwewillcontinuewithwillhavealookatTransaction/nSAT(ABAPTrace)andhowABAPTracewill
helpusonourjourneytoperformantABAPonHANAprogramming.

17130Views
Topics:abapTags:hana,code_inspector,sql_trace,abap4hana,abaponhana,abapforhana,abapinhana,abap_for_hana,
abap_trace

AverageUserRating
(10ratings)

Share

10

Tweet

Like

13Comments
AbyJacob09Jun201313:20

Excellent!!Thanksforsharing
Like(0)

AbdulHakim10Jun201312:17

Usefulinfo.Thanksforsharingwiththecommunity.
Like(0)

SimonRotherham27Jun201323:57

AgreatblogthatisnotjustrelevantforABAPonHANAbutalsorelevantforallABAPdevelopersin
ordertoproduceefficientcode.
Like(0)

TrondStroemme24Sep201313:12

Verythoroughanduseful.ButofcoursetherealgainwithHANAispushingcodedowntotheDB
layeravoiding(toomuch)OpenSQLinyourABAPcode.
Like(0)

SyamBabu15Apr201421:03

WellWritten...Thanks.
Like(0)

HyukJooLee09Jan201501:59

Thanks!
Like(0)

HeecheolYeom14Jan201510:09

Ishouldsaythatthisisveryhelpfulblog!Thanksforblogging.

I'malreadyexcitedtonextblog.
Like(0)

RiazGhouse09Dec201507:24

VeryHelpfulandclear

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

13/14

1/24/2016

ABAPonHANAfromanalysistooptimization|SCN

Like(0)

RaghuveerSaireddy21Dec201513:03

Verywellexplained,PointtoPoint..verywellwritten:)
Like(0)

RameshNatarajan22Dec201504:58

Eachandeverypointsarewellexplained.
Like(0)

ThomasFiedler22Dec201509:12

HiManfred,
werecommendtousetheSQLmonitor(transactionSQLM)todetectperformanceissuesand
optimizationpotentialinyourcode.

OptimizingCustomABAPCodeforSAPHANATheNewABAPSQLMonitor.pdf

InthemeanwhilethereisalsoanEclipsebasedtoolingforSQLMfindings:
3SimpleStepstoIdentifyPerformanceHotspotsinABAPCustomCode

Giveitatry.

Regards,
Thomas.
Like(0)

MarkusZoeller20Jan201608:58

HiAll,

isthereagoodrecommendationorapproachthatdescribestheanalysistoidentifypotentialy
unnecessary"SecondaryIndices"whenmovingfromclassicDB(e.g.ORACLE)toHANADB.

ThanksandRegards
Markus
Like(0)

LarsBreddemann20Jan201613:52(inresponsetoMarkusZoeller)

Thequestionisnotsomuchwhethertherearepotentiallyunnecessarysec.indexes,but
rather:ofallthesec.indexesinthesystem,whichonescouldpotentiallybeuseful?

Sincetheindexingoptions,strategiesandreasonsforOraclearefundamentallydifferent
thanforSAPHANA,therecommendationis:getridofallsecondaryindexes(especially
thoseonemorethanonecolumn)andreviewtheperformanceofyourapplicationonSAP
HANA.

YoumightwanttocheckSAPnotes

2160391 FAQ:SAPHANAIndexes
2000002 FAQ:SAPHANASQLOptimization

forfurtherreadingonthis.
Like(0)

SiteIndex
Privacy

ContactUs
TermsofUse

SAPHelpPortal
LegalDisclosure

Copyright

http://scn.sap.com/community/abap/hana/blog/2013/06/05/abaponhanafromanalysistooptimization

FollowSCN

14/14

Vous aimerez peut-être aussi