ChandruN:
- Update
pro: easy to submit ;-)
contra: needs space for the transient journal and a loooong time to rollback in case of failure
- Insert/Select using CASE to modify the data on the fly
pro: probably the fastest way, immediate rollback. Only a read lock on source table during copy, fast switch to the new version using drop old_table; rename new_table to old_table.
contra: you need the perm space to store the copy of the table
- export all rows including the modifications and use FastLoad
pro: No rollback. Read lock/Fast switch similar to Insert/Select. If there's not enough perm space to hold the copy, you can delete the table before fastloading.
contra: you have to export all the data (if there's enough perm space without storing on system disks using export -> named pipe -> fastload). If there's no perm space for the copy table is not accesible during the load.
- export the modified data plus the PK and use MLoad
pro: less data to export (compared to FastLoad)
contra: perm space needed for work tables. Table only accesible during load with Access lock.
Everything is better than updating 30% of rows ;-)
BillDHS:
20 hours for 1 mio updates is extremely slow. Did you modify the primary index and/or did you have secondary indexes/foreign keys/join indexes and modified those columns?
In V2R5 updates are *much* faster now, because there's an update in place instead of delete/merge.
In your case (< 1%) this might be faster than insert/select now, but even if it is, there's still the possible rollback :-(
Rollback ss probably also faster now, but i never tested it.
Dieter