Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Performance improvement

Former Member
0 Likes
493

Hi All,

How the performance is improved when we use the view in the select statement rather than using database table name directly with join statement?

3 REPLIES 3
Read only

Former Member
0 Likes
470

1. First remove occurs 0 and occurs 0,

use types and delcare structure.

then declare internal table.

ex-

types: begin of ty_lfa1,

kunnr like kna1-kunnr,'end of ty_kna1.

data : i_kna1 type standard table of ty_kna1 with header line.

instead of inner join use for allentries.

into corresponding fields of will decrease performance.

delete adjacent duplicates from itab_final comparing matnr lgort.

place it outside the loop.

 before every select statenet check sy-subrc = 0.if sucessful the write another one.

 don’t' loop an internal table more than once.

and for better performane follow below points

Always check the driver internal tables is not empty, while using FOR ALL ENTRIES

Avoid for all entries in JOINS

Try to avoid joins and use FOR ALL ENTRIES.

Try to restrict the joins to 1 level only ie only for tables

Avoid using Select *.

Avoid having multiple Selects from the same table in the same object.

Try to minimize the number of variables to save memory.

The sequence of fields in 'where clause' must be as per primary/secondary index ( if any)

Avoid creation of index as far as possible

Avoid operators like <>, > , < & like % in where clause conditions

Avoid select/select single statements in loops.

Try to use 'binary search' in READ internal table. Ensure table is sorted before using BINARY SEARCH.

Avoid using aggregate functions (SUM, MAX etc) in selects ( GROUP BY , HAVING,)

Avoid using ORDER BY in selects

Avoid Nested Selects

Avoid Nested Loops of Internal Tables

Try to use FIELD SYMBOLS.

Try to avoid into Corresponding Fields of

Avoid using Select Distinct, Use DELETE ADJACENT

Go through the following Document

Check the following Links

http://www.sapgenie.com/abap/performance.htm

http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp

check the below link

http://www.sap-img.com/abap/performance-tuning-for-data-selection-statement.htm

See the following link if it's any help:

http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp

Check also http://service.sap.com/performance

regards

Suresh.D

Read only

Former Member
0 Likes
470

Hi,

Generally speaking, View are more closly binded with database as it is part of database . so decideing field types and structure doesnot table time also link are automatically esatblished this time is alos saved ...

instead, select stmt decides at runtime what filed will be fetched, this takes some time...

So performance is improved using views rather than select statement.

Jogdand M B

Read only

Former Member
0 Likes
470

It partly depends on the database - I've seen it where a JOIN is quicker (but only maginally) than a view.

The first time the ABAP runs it does take a bit longer, but after that it uses the execution path and so runs faster.

Defining a view means that the join has to be rebuilt every time it is used.