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

Inner Join Performance

Former Member
0 Likes
430

Hi Folks,

I m using this particular inner join.

The performance is quite good in development system but in Prod. System performance become very low.

SELECT GMBLNR GBWART GXAUTO GMENGE GDMBTR FBUDAT F~XBLNR

INTO TABLE IT_TEMP

FROM

MSEG AS G

INNER JOIN

MKPF AS F

ON GMBLNR = FMBLNR AND

GMJAHR = FMJAHR

WHERE G~BWART IN ('101','102','601','602','309','321','322') AND

G~MATNR EQ IT_MARA-MATNR

AND G~WERKS IN PLANT

AND G~LGORT IN S_LGORT

AND F~BUDAT GE VARDATELOW

AND F~BUDAT LE VARDATEHIGH.

What i can do to make the performance high.

Thanks

-


Sachin

4 REPLIES 4
Read only

Former Member
0 Likes
390

Well,, a slight change can be done.

SELECT GMBLNR GBWART GXAUTO GMENGE GDMBTR FBUDAT F~XBLNR

INTO TABLE IT_TEMP

FROM

MSEG AS G

INNER JOIN

MKPF AS F

ON GMBLNR = FMBLNR AND

GMJAHR = FMJAHR

WHERE G~BWART IN ('101','102','601','602','309','321','322') AND

G~MATNR EQ IT_MARA-MATNR

AND G~WERKS IN PLANT

AND G~LGORT IN S_LGORT

AND F~BUDAT <b>BETWEEN VARDATELOW AND VARDATEHIGH</b>.

Read only

dani_mn
Active Contributor
0 Likes
390

HI,

You can use secondary index to make performance better and also try to use 'FOR ALL-ENTRIES' instead of join.

Regards,

Wasim Ahmed

Read only

Former Member
0 Likes
390

Hi Wasim,

For which fields should i make secondery index and for which table.

Thanks

-


Sachin

Read only

Former Member
0 Likes
390

Hi,

Here are some tips..

Always Join from a ‘MASTER’ table to a ‘DETAIL’ table.

You cannot make an Inner Join good or bad by the order in which the

tables are specified in the FROM and JOIN clause.

The database optomizer ignores your order and ensures

that the data is accessed in the most efficient manner.

Regards,

Tanveer.

<b>Please mark helpful answers</b>