Application Development 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: 

Select statement

Former Member
0 Kudos

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

4 REPLIES 4

ThomasZloch
Active Contributor
0 Kudos

almost the same question like here

What's going on, is that really an actual problem of yours or rather a popular interview question at the moment?

Former Member
0 Kudos

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

0 Kudos

i am using SELECT SINGLE statement..will affect ???

0 Kudos

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.