Quantcast
Channel: SCN : Discussion List - SAP MaxDB
Viewing all articles
Browse latest Browse all 98

Bad performance with inner join

$
0
0

Hi,

I have the following SQL-statement with a very bad performance:

 

 

SELECT

T_00 ."ERSDA" , T_00 . "AUFNR" , T_00 . "VORNR" , T_00 . "PERNR" ,

T_00 . "RUECK" , T_00 . "AUERU" , T_00 . "STOKZ" , T_00 . "STZHL" ,

T_00 . "ILE01" , T_00 . "ILE03" , T_00 ."ISBD" , T_00 . "ISBZ" ,

T_00 . "IEBD" , T_00 . "IEBZ" , T_00 ."SATZA" , T_00 . "LTXA1" ,

T_00 . "ERNAM" , T_00 . "WERKS" , T_00 ."GMNGA" , T_00 . "ISM01" ,

T_00 . "ISM02" , T_00 . "ISM03" , T_00 ."XMNGA" , T_01 . "ARBPL" ,

T_01 . "AUFNR" , T_01 . "VORNR"

FROM

"AFRU" T_00 INNER JOIN "S022" T_01 ON T_01 . "MANDT" = ? AND T_01 . "AUFNR" =T_00 . "AUFNR"

AND T_01 . "VORNR" = T_00. "VORNR"

WHERE

T_00 . "MANDT" = ? AND T_00 . "WERKS" =? AND T_00 . "ERSDA" = ? AND T_00 ."PERNR" = ?

 

The indices are:

AFRU~Z01: MANDT, PERNR, BUDAT

AFRU~Z02: MANDT, WERKS, ERSDA, PERNR

S022~A: MANDT, SSOUR, VRSIO, WERKS, ARBPL, KAPAR, MATNR, AUFNR, PLNUM, POSNR, PLNFL, VORNR

 

It seems, that the indices will not be used.

 

Have you got an idea, how can I improve the performance from this statement? With a new index, or can I rebuild the statement to archive a better performance. It is very urgent.

 

Thank you very much for you answers.

 

Regards,

 

Stefan G.


Viewing all articles
Browse latest Browse all 98

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>