Link to home
Start Free TrialLog in
Avatar of gram77
gram77Flag for India

asked on

Long running task

I have a proc that is running since more than half an hour.

How can i expedite the procedure.


The proc is stuck at this update:

UPDATE IVRSN A
   SET BASE_PRICE =
          BASE_PRICE
          * CASE BASE_PRICE_CCY
               WHEN 'USD'
               THEN
                  1
               ELSE
                  (SELECT PX_MID_PRC
                     FROM UCUR_CCY_EXCH_RATE_VU
                    WHERE     AS_OF_DT = A.RELEASE_DATE
                          AND CCY_FROM_CD = A.BASE_PRICE_CCY
                          AND CCY_TO_CD = 'USD')
            END
          * (SELECT NVL (MULT_FACTOR_VAL, 1)
               FROM MD_CCY_MULT_FACTOR
              WHERE CCY_CD = A.BASE_PRICE_CCY),
       BASE_PRICE_CCY = 'USD',
       CLOSE_PRICE =
          CLOSE_PRICE
          * (SELECT NVL (MULT_FACTOR_VAL, 1)
               FROM CCY_MULT_FACTOR
              WHERE CCY_CD = A.CONSTITUENT_CURRENCY_CODE)
 WHERE A.AS_OF_DT = :B1


There is a Row-X (SX) mode DML lock on table IVRSN and table partition IVRSN

Explain plan shows full table scan of IVRSN with cost of 6,00,000
ASKER CERTIFIED SOLUTION
Avatar of Christoffer Swanström
Christoffer Swanström
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of David VanZandt
Anything of interest in your alert.log, suggesting REDO log issues?  My two cents would be to curtail the data set -- so that the logic could be traced with a minimal number of records.
Avatar of gram77

ASKER

tosse:
The table ivrsn dosent have any indexes on it. It holds 32 GiGs of data, 17 million records.
and partitioned on as_of_dt while search is on release_dt


why is update generally slower then insert?
Avatar of gram77

ASKER

sorry, partitioned on release_dt while search is on as_of_dt