‎2006 Jun 23 7:19 PM
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!!
‎2006 Jun 23 7:21 PM
hi carlos,
<b>replace joins with FOR ALL ENTRIES variant for better performance.</b>
Cheers,
Abdul Hakim
‎2006 Jun 23 7:21 PM
hi carlos,
<b>replace joins with FOR ALL ENTRIES variant for better performance.</b>
Cheers,
Abdul Hakim
‎2006 Jun 23 7:25 PM
I don't quite understand. Are you doing this select in a loop?
Rob
‎2006 Jun 23 7:26 PM
If I put FOR ALL ENTRIES I need to put the read tables and the time to execute the program has been poor.
Thanks!
‎2006 Jun 23 7:31 PM
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
‎2006 Jun 23 7:27 PM
‎2006 Jun 23 7:31 PM
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
‎2006 Jun 23 7:34 PM
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