우선 튜닝을 하기위해서는
테이블의 구조와 데이타의 양,, 등을 알아야 해요
테이블의 PRIMARY KEY와 INDEX가 어떻게 구성되어 있는지 등을 자세히 모르고
튜닝은 힘들다고 봅니다.
그리고 MASTER가 되는 테이블을 선정해 보시는것도 중요하구요
우선 겹치는 SQL문을 조금 간단하게 수정해 보았습니다.
SELECT count(*)
FROM
"AFPO" T_00 , "AFKO" T_01 , "RESB" T_02 , "AUFK" T_03 , "MARA" T_04 , "MARC" T_05
WHERE
T_00.aufnr >= '000090000000'
AND T_00.aufnr <= '000099999999'
AND T_00 . "MANDT" = '700'
AND T_00 . "POSNR" = '0001'
AND T_00 . "AUFNR" = T_01 . "AUFNR"
AND T_00 . "MANDT" = T_01 . "MANDT"
AND T_00 . "AUFNR" = T_02 . "AUFNR"
AND T_00 . "MANDT" = T_02 . "MANDT"
AND T_00 . "AUFNR" = T_03 . "AUFNR"
AND T_00 . "MANDT" = T_03 . "MANDT"
AND T_02 . "MATNR" = T_04 . "MATNR"
AND T_00 . "MANDT" = T_04 . "MANDT"
AND T_02 . "MATNR" = T_05 . "MATNR"
AND T_00 . "MANDT" = T_05 . "MANDT"
AND T_01 . "GSTRP" BETWEEN '20060101' AND '20060207'
AND T_02 . "KZEAR" = ' '
AND T_02 . "XLOEK" = ' '
AND T_02 . "DUMPS" = ' '
AND T_02 . "SCHGT" = ' '
AND T_03 . "AUTYP" = '10'
AND T_03 . "WERKS" = 'C300'
AND T_04 . "MATKL" not IN ( 'PBA' , 'PBB','PCA','PCB','PCC','PCD','PCE','PDA','VDA','VCD','VCC','VCB','VCA','PAA','PAB','PAC','PAD',
'PAEPAF','PAG','PAH','VAA','VAB','VAC','VAD','VAE','VAF','VAG','VAH')
AND T_05 . "DISPO" <> 'ZME'
AND T_05 . "WERKS" = 'C300'