‎2005 Dec 21 7:41 AM
Hello,
Does anyone has a documentation about cause of low performance of select ... endselect statement.
Thanks in advance,
Roy.
‎2005 Dec 21 8:39 AM
‎2005 Dec 21 7:43 AM
Hi
Select Endselect will give worse perfomance instead use SELECT..INTO TABLE addition.
Thanks,
Abdul
‎2005 Dec 21 7:46 AM
Hi,
Selecting data into an internal table using an array fetch versus a SELECT-ENDELECT loop will give at least a 2x performance improvement. After the data has been put into the internal data, then row-level processing can be done.
Example:
select ... from table <...>
into <itab>
where ...
loop at <itab>
<do the row-level processing here>
endloop.
Best regards,
Prashant
‎2005 Dec 21 7:48 AM
Hi Roy,
These links will solve your problem
http://www.sapgenie.com/abap/performance.htm
http://www.thespot4sap.com/Articles/SAPABAPPerformanceTuning_PerformanceAnalysisTools.asp
http://www.sapdevelopment.co.uk/perform/performhome.htm
Regards
Sudheer
‎2005 Dec 21 8:39 AM
‎2005 Dec 21 9:58 AM
Hi Ofir
Select-Endselect provides a looping mechanism in which every time the database is accessed and the retrieved record is stored in the work area. Since number of data transfers and DB accesses are high, it causes low performance.
First to know about low performance of some ABAP statements, you should know the underlying system architecture and other performance factors. You can find it in the below url.
<a href="http://">http://help.sap.com/saphelp_nw04s/helpdata/en/fc/eb3b7e358411d1829f0000e829fbfe/frameset.htm</a>
Check this out. Dont forget to reward, if its worth :-).
Regards
Rakesh
‎2005 Dec 21 2:46 PM
Hi Roy,
Here is what happens at the database level.
With a select/endselect statement the database opens a cursor and fills it with the solution set for the selection criteria with the first database access. However since the retrival structure (the work area that you select into) only holds one record, the data is retrived in a looping mechanism where the database hands you one record at a time. So, if your selection criteria yields 100 records, you have 100 network hits as you go back and forth to the database carrying back one record at a time.
With an array fetch (select into table) the entire contents of the database cursor are placed directly into your internal table in a single network hit. If you have 100 records, all 100 records are retrieved in one network hit.
The bottom line with ABAP is: Application server is fast, database server is slow - try to limit your contact with the database server.
Hope this helps.
Brent
‎2005 Dec 21 3:06 PM
Hi,
In ABAP Editor goto
Environment->Examples->Performance Examples.
There U can see the performance of select statements.
‎2005 Dec 21 3:08 PM
In addition to the explanation given by others, you can use PACKAGE SIZE n in select-endselect loop and decrease the database hits.
‎2005 Dec 21 3:19 PM
One of the problems with select/endselect is the increased network traffic across the servers. You do a select on the DB server and return the results to the app server. Then you repeat the process. As I understand it, that's why you try to as much of the data in as few trips to the database as possible.
On the other hand, doing an array fetch on a non-index field will give more of a performance hit than select/endselect.
rob