I have a table with about 3 million rows.
I have a procedure that updates one column with current values. This takes about 18 minutes.
My problem is that I need to also set the values to 0 for rows that are not in the source.
I started by updated the table and setting all values to 0 and then running my update proc. This is taking an additional 20 minutes now:
Step 1 - update table set column = 0
Step 2 open cursor SELECT primary_key, column FROM source_table.
Step 3 LOOP update table set column = cursor_value where primary key = cursor primary key.
any suggestions on how I can speed this up? I have bitmap indexes on most of the columns on this table. (74 Columns)
(25 indexes)
Perhaps I should drop these indexes and rebuild them once the proc has completed?
I have a procedure that updates one column with current values. This takes about 18 minutes.
My problem is that I need to also set the values to 0 for rows that are not in the source.
I started by updated the table and setting all values to 0 and then running my update proc. This is taking an additional 20 minutes now:
Step 1 - update table set column = 0
Step 2 open cursor SELECT primary_key, column FROM source_table.
Step 3 LOOP update table set column = cursor_value where primary key = cursor primary key.
any suggestions on how I can speed this up? I have bitmap indexes on most of the columns on this table. (74 Columns)
(25 indexes)
Perhaps I should drop these indexes and rebuild them once the proc has completed?