Refer to following “Quick Report” query which is taking 10+ minutes or even timing out on some occasions. Any ideas on increasing performance of this SQL query?
SELECT DISTINCT sp.activeind,
sp.catalog_desc,
sp.catalog_no,
sp.cf$_last_modified,
sp.contract,
sp.gtin_no,
sp.List_price,
sp.List_price_incl_tax,
sp.sales_price_group_id,
sp.sales_unit_meas,
spc.cf$_last_modified AS char_lastmodified,
spl.last_updated AS SalesPrice_LastUpdated
FROM Sales_part_cfv sp
LEFT JOIN Sales_Part_Characteristic_cfv spc ON sp.contract = spc.contract
AND sp.catalog_no = spc.catalog_no
LEFT JOIN SALES_PRICE_LIST_PART_PRICE spl ON sp.catalog_no = spl.catalog_no
WHERE sp.contract = '201'
AND (sp.cf$_last_modified >= '&datestring'
OR spc.cf$_last_modified >= '&datestring'
OR spl.last_updated >= TO_DATE('&datestring2', 'yyyy-MM-dd'))