Hi,
I have below sql statement. I would like to see if I can optimize the performance of it, as it is currently taking around 7 minutes to execute.
Any ideas on how I can improve the performance?
/BIC/ANSD300000 contains around 189.5 mio records
/BI0/MCUST_SALES contains around 1.7 mio records
/BIC/ANSD260000 contains around 7.5 mio records
SELECT s."/BIC/CUSHIER6", b."MATERIAL", b."BILL_DATE", b."NETVAL_INV" * b."BILL_QTY" as "Lastest NIP"
FROM
( ( "/BIC/ANSD300000" as b inner join "/BI0/MCUST_SALES" as s on
b."SOLD_TO" = s."CUST_SALES" and
b."DISTR_CHAN" = s."DISTR_CHAN" and
b."DIVISION" = s."DIVISION" and
b."SALESORG" = s."SALESORG" )
inner join "/BIC/ANSD260000" as o on
b."DOC_NUMBER" = o."DOC_NUMBER" )
WHERE
o."DOC_TYPE" = 'ZOR' and
b."BILL_TYPE" = 'ZF2' and
s."DATETO" = '99991231' and
b."DISTR_CHAN" = '01'
ORDER BY s."/BIC/CUSHIER6", b."MATERIAL", b."BILL_DATE" desc;
Thanks in advance.
KR
Torben