|Query Tuning [message #657919]
||Sun, 27 November 2016 23:14
Registered: February 2005
Thanks for your support so far.
I have the below query which is incorporated in the .NET code. When executing the application this query takes long time.
I have attached the explain plan for the same.
Request your help to fine tune this query. This has been already converted into MERGE.
Is there any other way this query can be fine tuned.
Please provide a suggestion for this.
MERGE INTO M_PRICES
USING (SELECT M_PRICES.ROWID row_id,
oldprice.price AS oldpricecur
WHERE M_PRICES.PRODUCTID = M_PRODUCTS.PRODUCTID
AND lower(nvl(trim(both ' ' from M_products.topitemno),' ')) = lower(nvl(trim(both ' ' from OLDPRICE.TOPITEMNO),' '))
AND lower(nvl(trim(both ' ' from M_products.subitemno),' ')) = lower(nvl(trim(both ' ' from OLDPRICE.SUBITEMNO),' '))
AND M_PRICES.CURRENCYCODE = OLDPRICE.CURRENCYCODE
AND M_PRICES.COUNTRYCODE = OLDPRICE.COUNTRYCODE
AND M_PRICES.INCOTERM = OLDPRICE.INCOTERM) src
ON ( M_PRICES.ROWID = src.row_id )
WHEN MATCHED THEN
SET oldpricecur = src.oldpricecur;
[mod-edit: image inserted into message body by bb]
[Updated on: Mon, 28 November 2016 15:15] by Moderator
Report message to a moderator