Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Sql Update from another table performance

513042Jul 7 2008 — edited Jul 7 2008
Hello I have the following query.

The subquery takes 2 mins if ran alone.
When I try to update off it , the process takes 30mins.
Is the subquery being executed for each row to update?

Please help


UPDATE TARGETS_TOLLFREE T3
SET MINS =( SELECT mins
FROM (SELECT ORIGINATION_LATA,ORIGINATION_OCN,
ROUND(SUM(INDURATION / 60) * 31* 1.3,0) AS MINS
FROM TSM_CDRS.CDRS_NACT T2
WHERE calldate BETWEEN TRUNC(SYSDATE) -1 AND TRUNC(SYSDATE)
AND REGEXP_LIKE('800;888;866;877;855',SUBSTR(DNIS,1,3))
GROUP BY ORIGINATION_LATA,ORIGINATION_OCN) T2

WHERE t3.lata = t2.ORIGINATION_lata
AND t3.ocn = t2.ORIGINATION_OCN)

Comments

Processing
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Aug 4 2008
Added on Jul 7 2008
4 comments
1,680 views