‎2007 Apr 10 4:47 AM
This statement is taking more time.
How to improve the performance of this statement
SELECT DISTINCT cbukrs cwaers cprctr bkostl
akstar aversn a~gjahr
ap001 ap002 ap003 ap004 ap005 ap006
ap007 ap008 ap009 ap010 ap011 ap012
ap013 ap014 ap015 ap016
APPENDING TABLE itab_temp
FROM zvcoss AS a
JOIN zvcssl AS b ON aobjnr = bobjnr
JOIN zkcsks AS c ON bkostl = ckostl
WHERE ( a~lednr EQ '00'
AND a~versn EQ '000'
AND b~kostl IN r_ccde
AND a~wrttp EQ '04'
AND a~gjahr EQ p_fy
AND a~kstar GE '0000000000'
AND a~kstar LE '0000999999' ) .
‎2007 Apr 10 5:40 AM
try to minimize conditins in where clasue
ranges : r_kstar for zvcoss-kstar.
r_kstar-option = 'BT'
r_kstar-sign = 'I'
r_kstar-low = '0000000000'.
r_kstar-high = '0000999999' .
append r_kstar.
clear r_kstar.
<b>AND a~kstar in r_kstar.</b>
regards
Prabhu
‎2007 Apr 10 5:50 AM
Hi,
Try this :
1. do not use appending table clause.
2. use index keys in joins
Hope this will help.
‎2007 Apr 10 6:00 AM
hi jogdand,
can you tell me clearly abt the index key u have mentioned
‎2007 Apr 10 9:59 AM
Hi,
1.Avoid APPENDING CLAUSE in the select query.instead use temporary internal table and move into the final internal table.
2. Split the joins.
You can first go for a join on zkcsks and zvcssl and fetch the required records.
delete the duplicate entries and check if the table is inital. and then for all entries to fetch the data from zvcoss .
regards,
madhu
‎2007 Apr 11 1:24 PM
1.Select Distinct will cause perfromance issues, try to select the entire data and then use delete adjacent duplicates statement.
2. Try using brackets as given below for the join:
FROM ( ( zvcoss AS a JOIN zvcssl AS b
ON aobjnr = bobjnr )
JOIN zkcsks AS c ON bkostl = ckostl )
‎2007 Apr 11 3:25 PM
hi,
please remove distinct.
it will try to modify the database when executing this select and the results can be quite dangerous.
even now if the perfromance does not improve try For all entries statement..
thanks
Sunder