How to write a query to update alternate rows in a Table.
I mean whether all even rows or all odd rows should be updated from the query.
Is there any way to increase the performance if million of rows are there in some table.and if i want to update all the rows (single column in each row) then how can be make the process fast.
update my_table
set my_column = my_value
where mod(my_row_number,2) = 0;
Using the rownum is a very dangerous way, it is assigned dynamicly, so it is not always the same number for the same row
Increasing performance can be achieved by:
1 Partitioning and parallel processing
2 When updating some rows, use a proper index (function, bitmap, ...)
Bookmarks