2015 Oct 09 8:19 AM
Hi,
I have a simple select statement on table EKPO, looks like this:
SELECT ebeln
ebelp
aedat FROM ekpo
INTO CORRESPONDING FIELDS OF TABLE it_ekpo
WHERE ebeln IN ra_ebeln AND
aedat IN ra_aedat.
Range for EBELN is usually empty and in the change date range there is one entry SY-DATUM - 2 days, so getting all entries changed during last 3 days.
The select takes over 10 minutes. The only improvement I see is to make an index for AEDAT which does not exist yest, or does anyone have another suggestion?
Thanks,
Tim
2015 Oct 09 8:48 AM
I dont think there is any other solution. Try to create INDEX on AEDAT and put a select on AEDAT only as in your case EBELN is having blank range.
I dont think there is any other solution. Try to create INDEX on AEDAT and put a select on AEDAT only as in your case EBELN is having blank range.
2015 Oct 09 8:48 AM
I dont think there is any other solution. Try to create INDEX on AEDAT and put a select on AEDAT only as in your case EBELN is having blank range.
2015 Oct 09 8:54 AM
Hi,
Put all fields in it_ekpo as in the order of select query. i.e. eblen, ebelp and aedat and after that remove CORRESPONDING FIELDS from select.
I hop this will improve the performance.
Regards
Ajay
2015 Oct 09 9:15 AM
Hello Tim,
try to select last 1000 record this:
data: lv_ebeln type ekpo-vbeln.
select max(ebeln) from ekpo into lv_ebeln.
lv_ebeln = lv_ebeln - 1000.
SELECT ebeln
ebelp
aedat FROM ekpo
INTO CORRESPONDING FIELDS OF TABLE it_ekpo
WHERE ebeln IN ra_ebeln AND
ebeln > lv_ebeln
aedat IN ra_aedat.
This Solution works only if you have one number range for ekes-ebeln.
Regards,
Richard
2015 Oct 09 9:19 AM
Hi,
please check table CDHDR OBJECTCLAS = EINKBELEG. Maybe you kann use this table in a JOIN to improve performance.
Regards
Michael
2015 Oct 09 9:22 AM
Hello Tim,
Yes.. best way is to create Index for date field.
Thanks,
Sujeet
2015 Oct 09 11:16 AM
Hi Tim,
You can check in the following for SELECT query. Certain points to ponder upon -
Apart from these you can also go for creating secondary indexes. There will definitely an performance improvement.
Cheers,
Varun
2015 Oct 09 10:20 PM
I'm sure Tim appreciates the tips, except:
- he's clearly not using SELECT *
- his SELECT already using the primary key in this table and he's already clarified search has to be by date
- INTO CORRESPONDING is an urban legend - see this document.
As others already said - index is pretty much the only option, unfortunately. Change documents are not indexed by date either.
Thank you.
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |