Link to home
Start Free TrialLog in
Avatar of sakthikumar
sakthikumar

asked on

Parallel update or serial update or bulk update.?

I want to update a table of 5 million rows.(Want to update all rows)

I want to update a newly added column with old one old column.

Which method I should choose,

I tried using simple update statement like the following

update contrs
set uno_temp = uno;


But this takes huge time, Please suggest me a best approach.
Avatar of Sean Stuber
Sean Stuber

the simple update should be the fastest way.

if it's taking a very long time, you're probably waiting on other sessions that have one or more rows locked.

Another thing to consider is you might be waiting on lots of row migration.

Check your wait states what is it your update is waiting on?
if the table is partitioned you might get some benefit from using the parallel hint


also, I'm assuming here and above that the column in question is a simple number, date or varchar2 (something small) not  CLOB or BLOB
Avatar of sakthikumar

ASKER

yes it is not a blob or clob. And also no row locks from other sessions.

how to check wait states, any way without running AWR?
SOLUTION
Avatar of Sean Stuber
Sean Stuber

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
ASKER CERTIFIED SOLUTION
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
SOLUTION
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
I forgot to check the triggers for the table.

Disabling the trigger does the trick, Statement executed in 1 minute.

Thanks everyone.
You're welcome :)