2019 Jan 23 1:31 PM
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.
2019 Jan 23 2:32 PM
Are views V_STAT or V_JSTO_JEST active in your database, else did you check access plan from a SQL trace?
thx for the feedback ! please use the option to convert your "answer" into a comment, under Raymond's answer
2019 Jan 23 2:32 PM
Are views V_STAT or V_JSTO_JEST active in your database, else did you check access plan from a SQL trace?
2019 Jan 23 2:56 PM
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?
2019 Jan 27 4:28 PM
"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.
2019 Jan 23 8:57 PM
I really don't know JSTO, not JEST, but it looks like you can use some kind of JOIN instead of using EXISTS.
J.
2019 Jan 23 8:59 PM
Please attach the Execution Plan to your question, otherwise how can you know where the issue is!? (aka access plan as said Raymond)
2019 Jan 27 12:11 PM
thanx you all by using the view V_JSTO_JEST (and the program logic) i solved the issue, the performance is now acceptable
2019 Jan 27 12:58 PM
thx for the feedback ! please use the option to convert your "answer" into a comment, under Raymond's answer
| User | Count |
|---|---|
| 3 | |
| 2 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |