‎2008 Nov 24 11:54 AM
HI all
i am working on performance improvment.
this is sql stst as below.
SELECT * APPENDING TABLE t_tj02t
FROM tj02t
WHERE istat IN r_status
AND spras = sy-langu.
but it's not giving performance in se30.
how can i replace the for for betterment.
‎2008 Nov 24 12:29 PM
>
> SELECT * APPENDING TABLE t_tj02t
> FROM tj02t
> WHERE istat IN r_status
> AND spras = sy-langu.
the SELECT uses the full key, so this statement could not make any performance issue. There are "only"a few thousands entries in this table (even if r_status is empty), it shouldn't be any problem by this select. Replacing the APPENDING with INTO TABLE makes some sense, but I wouldn't expect a dramatic improvement.
If there is performance issue in your program, it is not because of the above SELECT.
‎2008 Nov 24 12:00 PM
Hi,
Try out your query this way
SELECT * from tj02 into table t_tj02t
WHERE istat IN r_status
AND spras = sy-langu.
Hope it helps u out.
Thanks & Regards
‎2008 Nov 24 12:09 PM
‎2008 Nov 24 12:30 PM
Hi,
If you use appending it specifies that u r using the statement in your loop.
You use Appending When already u have data in your itab and then yoiu want further rows to be added.
According to my understanding of your requirement you want you data to be collected in an itab without any prior records. So there is no need for using append if this is the case.
Also if possibel try to use other primary keys and indexes in your queries. It will serve u much better.
Hope it helps u.
Thanks & Regards
‎2008 Nov 24 12:01 PM
How many values you have in r_status? If it is very long then I would advice to get all records from the
tj02t table and then use read table statement to find the value in the internal table. This is faster than having huge list of where clause values. Check out the number of records for your SY-langu... if it is few hundereds then it is ok to read it all in memory.
Hope this helps.
Franc
‎2008 Nov 24 12:04 PM
> but it's not giving performance in se30.
What does this mean? Are you sure this statement is causing problems? Is it inside a loop? How many entries does tj02t have?
Thomas
‎2008 Nov 24 12:08 PM
‎2008 Nov 24 12:29 PM
>
> SELECT * APPENDING TABLE t_tj02t
> FROM tj02t
> WHERE istat IN r_status
> AND spras = sy-langu.
the SELECT uses the full key, so this statement could not make any performance issue. There are "only"a few thousands entries in this table (even if r_status is empty), it shouldn't be any problem by this select. Replacing the APPENDING with INTO TABLE makes some sense, but I wouldn't expect a dramatic improvement.
If there is performance issue in your program, it is not because of the above SELECT.
‎2008 Nov 24 2:37 PM
Make sure that r_status is not empty.
And don't do this in a loop.
Rob
Edited by: Rob Burbank on Nov 24, 2008 10:16 AM
‎2008 Nov 24 2:56 PM
> WHERE istat IN r_status
the ABAP statement, where the range comes from, is a useless information! You need to tell
us the database statement as in the detail of the SQL trace or what you see in the debugger, or
what you type in the select-option.
r_status can have any type of condition, not only the empty condition is a problem, it can contain
not equal condition, interval and whatever, oir even combinations of these, all these make the access slower or even really slow!
And don't forget, execute the select twice before you judge the performance, we are not talking about intialization costs.
APPENDING or INTO should make no difference at all, because it has no influence on the statement.
Of course if you do appending, then your internal table contains also the lines of the last select, which has effects on the further processing, but not on the SELECT.
Siegfried