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

select jsto jest optimisation

marco_sposa
Participant
0 Likes
2,225

Hello Folks,

i'm trying to optimize a select really poor on performance, any idea on how to change the join in order to have a better performance please?

 SELECT objnr FROM jsto AS a APPENDING CORRESPONDING FIELDS OF

                      TABLE onr_tab WHERE a~objnr IN r_s_objnr AND

                                          a~obtyp EQ sdcon-item AND

                                          a~stsma NE stsma_ini AND

             EXISTS ( SELECT objnr FROM jest WHERE objnr EQ a~objnr AND

                     stat LIKE 'E%' AND inact EQ space ) ORDER BY OBJNR.
1 ACCEPTED SOLUTION
Read only

RaymondGiuseppi
Active Contributor
1,897

Are views V_STAT or V_JSTO_JEST active in your database, else did you check access plan from a SQL trace?

Hello Folks,

i'm trying to optimize a select really poor on performance, any idea on how to change the join in order to have a better performance please?

 SELECT objnr FROM jsto AS a APPENDING CORRESPONDING FIELDS OF

                      TABLE onr_tab WHERE a~objnr IN r_s_objnr AND

                                          a~obtyp EQ sdcon-item AND

                                          a~stsma NE stsma_ini AND

             EXISTS ( SELECT objnr FROM jest WHERE objnr EQ a~objnr AND

                     stat LIKE 'E%' AND inact EQ space ) ORDER BY OBJNR.
7 REPLIES 7
Read only

RaymondGiuseppi
Active Contributor
1,898

Are views V_STAT or V_JSTO_JEST active in your database, else did you check access plan from a SQL trace?

Read only

marco_sposa
Participant
0 Likes
1,897

yes they are both active in the database.

i will start using them and may changing the query by doing 2 selects then using two selects instead of one ( using for all entries ).

Am i in the good direction?

Read only

matt
Active Contributor
0 Likes
1,897

"then using two selects instead of one ( using for all entries ). Am i in the good direction?"

No. That's exactly the wrong thing to do. Don't do it.

Read only

Jean_Sagi
Participant
1,897

I really don't know JSTO, not JEST, but it looks like you can use some kind of JOIN instead of using EXISTS.

J.

Read only

Sandra_Rossi
Active Contributor
0 Likes
1,897

Please attach the Execution Plan to your question, otherwise how can you know where the issue is!? (aka access plan as said Raymond)

Read only

marco_sposa
Participant
0 Likes
1,897

thanx you all by using the view V_JSTO_JEST (and the program logic) i solved the issue, the performance is now acceptable

Read only

0 Likes
1,897

thx for the feedback ! please use the option to convert your "answer" into a comment, under Raymond's answer