Join Query Optimisation [message #37408] |
Wed, 06 February 2002 06:12 |
Nick Heppleston
Messages: 3 Registered: February 2002
|
Junior Member |
|
|
All, i have the following query which takes 12 minutes to execute - not being the world's greatest SQL programmer, i would appreciate your feedback as to how to optimise this query.
SELECT
TO_CHAR(sysdate, 'YYYY-MM-DD HH24:MM:SS') || '^' ||
rtrim(ndm_name) || '^UK^' ||
rtrim(ndm_addr1) || '^' ||
rtrim(ndm_addr2) || '^' ||
rtrim(ndm_addr3) || '^' ||
rtrim(ndm_postcode) || '^' ||
rtrim(ndm_addr4) || '^' ||
rtrim(ndm_addr5) || '^' ||
rtrim(cmp_lkspcode) || '^' ||
rtrim(cmp_product) || '^' ||
rtrim(cmp_desc) || '^' ||
rtrim(soi_itqty) || '^' ||
rtrim(soh_currency)
FROM midw.soitem, midw.cmprod, midw.sohead, midw.dlcust, midw.ndmas
WHERE
soh_orddate = TO_CHAR(sysdate, 'DD fmMonth YYYY')
AND soi_stloc = 'SALT'
AND soi_ordref = soh_ordref (+)
AND cmp_product = soi_product (+)
AND soh_account = dlcus_customer (+)
AND dlcus_ndcode = ndm_ndcode (+)
AND cmp_usage = '077';
Any help greatly appreciated - where do i start to look at optimising the query, pointers, tips anything!!
Cheers, Nick
|
|
|
|