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

Problem in the time to execute my program.

Former Member
0 Likes
948

Hi,

I need to search some tables that have much information. First I decide to make indexs to the tables to resolve the problem in the selects and the time to extract the data is repair but the program late 48 minutes because have 1 loop and 2 read table, so I decide to make joins in the tree tables to erase the two read tables but the time of the performance not change very much and this is only in the first month and I think what is happen if I search the twelve months!!

This is the select that I only have in my code:


  SELECT a~ryear a~rpmax a~rtcur a~racct a~rbukrs a~prctr
         a~kslvt a~ksl01 a~ksl02 a~ksl03 a~ksl04 a~ksl05
         a~ksl06 a~ksl07 a~ksl08 a~ksl09 a~ksl10 a~ksl11
         a~ksl12 a~ksl13 a~ksl14 a~ksl15 a~ksl16 b~saknr
         b~txt20 b~ktopl c~day_a c~racct c~prctr    
         c~per_day c~average c~agregate c~accumulate 
         c~average_sap
     FROM  faglflext as a join skat as b 
           on a~racct = b~saknr 
           join zavg_bal_table as c      
           on a~racct = c~racct and a~prctr = c~prctr
    INTO CORRESPONDING FIELDS OF TABLE t_itab1
    where  a~rbukrs IN p_bukrs
      and  a~rldnr  = '0L'
      AND  a~racct  NE ''
      AND  a~ryear  = p_date+0(4)
      and  b~spras  eq sy-langu
      AND  b~ktopl  EQ 'CAPI'
      and  c~day_a  = p_date.

Thanks for the help people!!

1 ACCEPTED SOLUTION
Read only

abdul_hakim
Active Contributor
0 Likes
914

hi carlos,

<b>replace joins with FOR ALL ENTRIES variant for better performance.</b>

Cheers,

Abdul Hakim

7 REPLIES 7
Read only

abdul_hakim
Active Contributor
0 Likes
915

hi carlos,

<b>replace joins with FOR ALL ENTRIES variant for better performance.</b>

Cheers,

Abdul Hakim

Read only

Former Member
0 Likes
914

I don't quite understand. Are you doing this select in a loop?

Rob

Read only

Former Member
0 Likes
914

If I put FOR ALL ENTRIES I need to put the read tables and the time to execute the program has been poor.

Thanks!

Read only

0 Likes
914

hi carlos,

with FOR ALL ENTRIES you could split your SELECT variant into two clauses which in turn will reduce the time taken by your program at the database server level.

later on you could loop thru the two itabs to get your desired result.i hope this will improve your performance.

have you tried this??.if not plz try it and check the runtime using runtime analysis.also do SQL Trace...

Cheers,

Abdul Hakim

Read only

Former Member
0 Likes
914

No, is outside the loop, not into.

Read only

Former Member
0 Likes
914

Hi Carlos,

have you made a SQL-trace (ST05) to analyze the indices that the database use?

Can you post the indexes of these tables?

If any of the tabled are buffed, then the access with the join do not use the buffer.

Regards,

Stefan

Read only

Former Member
0 Likes
914

I only have one of the three tables that you are using in our system, but it looks like you aren't using any fields in an index in your select.

  AND  a~racct  NE ''

won't use an index on racct (if there is one).

Rob