Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

performance tuning problem

Former Member
0 Likes
936

Hi,

I have a select query as shown below. here i am facing the performance issue with the this query. can any one plz suggest the better way to optimize the performance of this query....?

SELECT ekkoebeln ekkoloekz ekkolifnr ekkoekorg ekko~ekgrp

ekpowerks ekpopstyp ekpoloekz ekpoelikz ekpo~menge

ekpomatnr eketebeln eketebelp eketetenr eket~rsnum

eket~eindt INTO

(ekko-ebeln, ekko-loekz, ekko-lifnr, ekko-ekorg, ekko-ekgrp,

ekpo-werks, ekpo-pstyp, ekpo-loekz, ekpo-elikz, ekpo-menge,

ekpo-matnr, eket-ebeln, eket-ebelp, eket-etenr, eket-rsnum,

eket-eindt)

FROM eket INNER JOIN ekpo

ON ( eketebeln = ekpoebeln AND

eketebelp = ekpoebelp )

INNER JOIN ekko

ON ( ekpoebeln = ekkoebeln )

WHERE ekko~ebeln IN ebeln

AND ekko~loekz EQ ' '

AND ekko~lifnr IN lifnr

AND ekko~ekorg IN ekorg

AND ekko~ekgrp IN ekgrp

AND ekpo~werks IN werks

AND ekpo~pstyp EQ '3'

AND ekpo~loekz EQ space

AND ekpo~elikz EQ space

AND ekpo~menge NE 0

AND eket~rsnum NE space.

some statements...

....

endselect.

1 ACCEPTED SOLUTION
Read only

Former Member
0 Likes
903

Please adopt following methods

1. Please write separate SELECT statments so query will be faster since join on three table takes lot of memory time.

2. User database view to select data from EKKO and EKPO and then select data from EKET table since you have user

 AND eket~rsnum NE space 

to restrict EKET table.

3. Please get all the key fields in WHERE conditions.

Please use ST05 trace to check if indexes are used by optimizer to select data or table is scanned.

If it is scanned then you need to rewrite the WHERE clause.

Regards,

Sunil

Edited by: Sunil Sawaikar on Mar 23, 2009 12:38 PM

Edited by: Sunil Sawaikar on Mar 24, 2009 7:33 AM

7 REPLIES 7
Read only

Former Member
0 Likes
903

WHERE ekko~ebeln IN ebeln
AND ekko~loekz EQ ' '
AND ekko~lifnr IN lifnr
AND ekko~ekorg IN ekorg
AND ekko~ekgrp IN ekgrp
AND ekpo~werks IN werks
AND ekpo~pstyp EQ '3'
AND ekpo~loekz EQ space
AND ekpo~elikz EQ space
AND ekpo~menge NE 0
AND eket~rsnum NE space.

Please add which IN clauses are actually filled !!!!

Read only

0 Likes
903

Hi,

we are filling ekorg and werks feilds in the selection screen.

Read only

Former Member
0 Likes
903

SELECT.....ENDSELECT Degrades the preformance.It increases the database hits.

So more number of hits degrades performance.

Just use array operation...(i.e INTO TABLE)

SELECT <FIELDS> FORM <TABLE> INTO TABLE <ITAB>.

Regards,

Gurpreet

Read only

Former Member
0 Likes
904

Please adopt following methods

1. Please write separate SELECT statments so query will be faster since join on three table takes lot of memory time.

2. User database view to select data from EKKO and EKPO and then select data from EKET table since you have user

 AND eket~rsnum NE space 

to restrict EKET table.

3. Please get all the key fields in WHERE conditions.

Please use ST05 trace to check if indexes are used by optimizer to select data or table is scanned.

If it is scanned then you need to rewrite the WHERE clause.

Regards,

Sunil

Edited by: Sunil Sawaikar on Mar 23, 2009 12:38 PM

Edited by: Sunil Sawaikar on Mar 24, 2009 7:33 AM

Read only

Former Member
0 Likes
903

> 1. Please write separate SELECT statments so query will be faster since join on

> three table takes lot of memory.

nonsense ... sorry, politeness does not help to stop this repeated nonsense.

This is simply incorrect!

Read only

Former Member
0 Likes
903

hi:

i would advice to use function module ADSPCM_READ_EKPO_ALL, instead of select statement

Where the matter of conditions are concerned , which can be taken in under loops.

Regards

Shashi

Read only

0 Likes
903

Hi sashi,

That function module ADSPCM_READ_EKPO_ALL is not available in my system.

is it standard one?

Thanks,

Dharani.