08-08-2008 3:16 PM
Hi all,
if i use around 10 select single statement in loop statement...will it affect any performance...
actually i m writing loop inside loop and then 10 selct single statements....
thx
08-08-2008 3:22 PM
08-08-2008 3:31 PM
create 10 internal table and select all the data from the select statement into it.
the use read statement inside tthe loop this will increase the performance of the report
08-08-2008 3:40 PM
08-08-2008 4:10 PM
Hi,
What ever it is!!!!!!!
Select single or select into table will definitely affects the performance. Instead of that fetch the data at one go using FOR ALL ENTRIES and read the table inside loop using BINARY SEARCH.
Remember when u r doing some thing in data base level it not only affects ur program performance but also other who is using that database. So imagine 10 SELECT SINGLEs inside NESTED LOOP.
eg: LOOP 1 has 10 records
LOOP2 has 20 records.
So total loop passes = 10 * 20 = 200.
Total fires on data base = 200*10 = 2000.
For 10 entries if u r firing 2000 times imagine of having lacks of entries in internal tables.
I hope u got the answer for ur question
Thanks,
Vinod.