ABAP 優化文件【來自網路】加個人體會 - 3
Proper structure of Where Clause:關鍵字排序的問題
When a base table has multiple indices, the where clause should be in the order of the index, either a primary or a secondary index.
To 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.
In certain scenarios, it is advisable to check whether a new index can speed up the performance of a program. This will come handy in programs that access data from the finance tables.
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.
個人體會:可能有效率,但是太麻煩了。
When multiple SAP tables are logically joined, it is always advisable to use inner join to read the data from them. This certainly reduces the load on the network.
Let 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 a~airln a~lnnam b~fligh b~cntry into table int_airdet
From zairln as a inner join zflight as b on a~airln = b~airln.
In order to restrict the data as per the selection criteria, a where clause can be added to the above inner join.
個人體會:他不說,我也是主動這麼乾地,為什麼呢,方便呀
Use of ABAP Sort instead of Order By
The order by clause is executed on the database server, while the sort statement is executed on the application server. Thus instead of giving the order by in the select clause statement, it is better to collect the records in an internal table and then use the sort command to sort the resulting data set.
個人體會:一個是伺服器做,一個是程式段做,本地做不影響系統效能吧
Tools provided for Performance Analysis
Following are the different tools provided by SAP for performance analysis of an ABAP object
- Run time analysis transaction SE30
This transaction gives all the analysis of an ABAP program with respect to the database and the non-database processing.
- SQL Trace transaction ST05
The trace list has many lines that are not related to the SELECT statement in the ABAP program. This is because the execution of any ABAP program requires additional administrative SQL calls. To restrict the list output, use the filter introducing the trace list.
The trace list contains different SQL statements simultaneously related to the one SELECT statement in the ABAP program. This is because the R/3 Database Interface - a sophisticated component of the R/3 Application Server - maps every Open SQL statement to one or a series of physical database calls and brings it to execution. This mapping, crucial to R/3s performance, depends on the particular call and database system. For example, the SELECT-ENDSELECT loop on the SPFLI table in our test program is mapped to a sequence PREPARE-OPEN-FETCH of physical calls in an Oracle environment.
The WHERE clause in the trace list's SQL statement is different from the WHERE clause in the ABAP statement. This is because in an R/3 system, a client is a self-contained unit with separate master records and its own set of table data (in commercial, organizational, and technical terms). With ABAP, every Open SQL statement automatically executes within the correct client environment. For this reason, a condition with the actual client code is added to every WHERE clause if a client field is a component of the searched table.
To see a statement's execution plan, just position the cursor on the PREPARE statement and choose Explain SQL. A detailed explanation of the execution plan depends on the database system in use.
個人體會:SE30 ,我喜歡
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/554557/viewspace-470537/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 5個小眾化的自媒體網站,速速收藏起來網站
- 通過自動化和現代化實現網路優化優化
- 自媒體高手不會告訴你的3個熱點網站!網站
- 自媒體人看過來,學會這三個方法,提高收益又增粉
- Python 3.8 新功能-來自社群翻譯貼-個人改進程式碼優化版Python優化
- 自媒體工具都有哪些?優秀的自媒體人都會用什麼工具?
- 自媒體人看過來:日入過百萬,3個副業平臺推薦
- 住宅IP的優勢與用途:打造個性化的家庭網路體驗
- 給 Eloquent 的 whereHas 加個 where in 的優化優化
- 運籌優化(八)--圖與網路優化優化
- MySQL效能優化 - 別再只會說加索引了MySql優化索引
- 自媒體人必備的熱點輿情分析,3個網站輕鬆搞定網站
- ABAP文件生成工具
- 3個關鍵點助力工業機器人自動化機器人
- 自媒體人怎麼追實時熱點熱搜榜?3個免費工具來了
- iOS效能優化 - 網路圖片載入優化iOS優化
- #自加運算在連續兩個printf中會累加
- 參加招聘會,申請加3分
- 7個自媒體網站,快來了解一下,收藏起來網站
- Oracle自帶工具sql優化集-SQL Tuning Advisor (使用心得體會)OracleSQL優化
- 自媒體人必備7個文案素材網站!免費網站
- 自媒體乾貨 | 自媒體人必備的4個創作神器,抓緊收藏起來
- 如何優化深度神經網路?優化神經網路
- TensorFlow神經網路優化策略神經網路優化
- 如何佈局未來網路:這3個方面是重點
- 自媒體不會找素材?試試這3個工具,效率翻倍!
- 自媒體創作網站有哪些?3個網站讓你事半功倍網站
- 百度App網路深度優化系列《一》DNS優化APP優化DNS
- 自智網路:網路自身的數字化轉型
- 漫漫優化路,總會錯幾步(記一次介面優化)優化
- 自媒體人如何寫熱點文章?3個爆文公式,直接套用公式
- 自媒體人漲粉攻略:3個免費的有效渠道,快收好
- 一個新手怎麼做自媒體?這些個人技巧快點學起來
- 【業務自動化平臺】上海道寧與UiPath致力於讓每個企業、每個人都能充分利用自動化帶來的成就和優勢UI
- 起碼得先活下來!網際網路創業少走彎路的3個忠告創業
- NeurIPS 2019 |自動優化架構,這個演算法能幫工程師設計神經網路優化架構演算法工程師神經網路
- 洞見未來無人零售,回看網際網路大會科技熱點
- 網路安全自學能學會嗎?網路安全如何學習
- 自媒體素材庫——月薪3W+自媒體人,私藏乾貨!