Update query running for long time
Hi
I am running update query which is taking long time (approx 3 Hrs)
UPDATE MSTR_AFFILIATIONS PARTITION (PAR_FR) A
SET A.CUSTOMER_TYPE =
(SELECT /*+ PARALLEL(6) */
MAX (B.CUSTOMER_TYPE)
FROM MSTR_CUST PARTITION (PAR_FR) B
WHERE A.COUNTRY_ID = B.COUNTRY_ID
AND A.CHILD_ID = B.customer_id
AND B.CUSTOMER_TYPE IS NOT NULL)
I think oracle execute select subquery for each row in partition par_fr to update the column, thats why its taking time.
Is there any way we can rewrite this query and have less CPU COST.
As of now CPU cost is huge above 100K.