2006 Feb 10 10:46 AM
There is a performance issue for table EKPO.
We have matnr, werks and loekz fields to match.
We dont have the key fields ebeln and ebelp.
The query is as follows:
select ebeln ebelp matnr werks
from ekpo
where matnr in s_matnr
and werks in s_werks
and loekz ne 'L'.
Index 1 for this table is:
matnr, werks, bstyp, loekz, elikz, matkl
Since we dont have bstyp. would the query fetch data based on index1.
Or should we remove 'loekz' from the where clause, populate internal table based on matnr, werks and Later delete the entries from internal table based on loekz.
Would this improve the performance ?
There is a performance issue for table EKPO.
We have matnr, werks and loekz fields to match.
We dont have the key fields ebeln and ebelp.
The query is as follows:
select ebeln ebelp matnr werks
from ekpo
where matnr in s_matnr
and werks in s_werks
and loekz ne 'L'.
Index 1 for this table is:
matnr, werks, bstyp, loekz, elikz, matkl
Since we dont have bstyp. would the query fetch data based on index1.
Or should we remove 'loekz' from the where clause, populate internal table based on matnr, werks and Later delete the entries from internal table based on loekz.
Would this improve the performance ?
2006 Feb 10 11:00 AM
Hi,
The order of the fields in the index is very important for the accessing speed.
If u create another index using fields matnr, werks, loekz then it really improve ur program Speed.
Regards,
Digesh Panchal
2006 Feb 10 11:03 AM
Hi,
a delete of entries in internal table is very fast. But, you have to check the size of the internal table, if you select without restrict the LOEKZ.
I prefere the delete solution, but, that could be dangerous for the memory.
Rgd
Frédéric
2006 Feb 10 11:23 AM
First and foremost with select stmt it will try to find the best primary or alternative index. in ur case as it doesn't match the index 1 it will still go sequentially and will degrade the performance.
two options.
1. remove the field loekz and get all the data (hope not huge) into internal table and then process as handling internal table is fast.
2. Create alternate index but I am not sure if this is allowed as it also creates additional buden of database as it needs to keep all the alternate index update everytime a new entry happens or when deleted.
2006 Feb 10 11:25 AM
Missed one more point. u could use SQL trace to check if the index used by the system is the one which u want else force the DB to select the one which u want.
2006 Feb 10 2:17 PM
Check out the OSS note # 561331.
Also go to t-code St02 and st03 ... to check table performance...
Hope this`ll help you .
Thanks
2006 Feb 10 2:20 PM