Hi ,
I am facing on issue of bad performance when trying to query AUSP table using For all entries and Inner join on
INOB and AUSP table .
Below are the 2 queries , I am using :
1) First query is on AENR table , to fetch the Change masters(AENNR field) , which are around 1 , 90 ,000 records . This works well with no performance issue .
2) In the second query ,I am trying to fetch the Change master characteristic data(ATWRT field) for all the change masters fetched in the first query , from AUSP table with a join on INOB table , for a given characteristic(ATINN) value .
But I am facing a big performance issue here .
Below is the SQL query execution plan for the query .
SELECT
T_00."OBJEK", T_01."ATWRT"
FROM
"INOB" T_00 INNER JOIN "AUSP" T_01 ON T_01."MANDT"=:A0 AND T_00."CUOBJ"=T_01."OBJEK" AND T_00."KLA
RT"=T_01."KLART"
WHERE
T_00."MANDT"=:A1 AND T_00."OBTAB"=:A2 AND T_00."OBJEK" IN (:A3 ,:A4 ,:A5 ,:A6 ,:A7 ,:A8 ,:A9
,:A10 ,:A11 ,:A12 ,:A13 ,:A14 ,:A15 ,:A16 ,:A17 ,:A18 ,:A19 ,:A20 ,:A21 ,:A22 ,:A23 ,:A24 ,:A25
,:A26 ,:A27 ,:A28 ,:A29 ,:A30 ,:A31 ,:A32 ,:A33 ,:A34 ,:A35 ,:A36 ,:A37 ) AND T_00."KLART"=:A38
AND T_01."KLART"=:A39 AND T_01."ATINN"=:A40 AND T_01."ATWRT"=:A41
Execution Plan
SELECT STATEMENT ( Estimated Costs = 2 , Estimated #Rows = 1 )
6 FILTER
Filter Predicates
5 NESTED LOOPS
3 NESTED LOOPS
( Estim. Costs = 1 , Estim. #Rows = 1 )
Estim. CPU-Costs = 9,061 Estim. IO-Costs = 1
1 INDEX RANGE SCAN AUSP~N1
( Estim. Costs = 1 , Estim. #Rows = 1 )
Search Columns: 4
Estim. CPU-Costs = 5,747 Estim. IO-Costs = 1
Access Predicates Filter Predicates
2 INDEX UNIQUE SCAN INOB~0
Search Columns: 2
Estim. CPU-Costs = 1,804 Estim. IO-Costs = 0
Access Predicates
4 TABLE ACCESS BY INDEX ROWID INOB
Estim. CPU-Costs = 3,314 Estim. IO-Costs = 0
Filter Predicates
Please provide any comments or suggestions
Thanks