Delete,insert,update與undo的關係[轉載TOM文章]

lovehewenyu發表於2013-10-21

Delete,insert,update 與undo的關係

Delete,insert,update與undo的關係[轉載TOM文章] Delete,insert,update與undo的關係[轉載TOM文章] What is relationship (delete,insert,update) and undo?


during an insert - we have to generate undo equivalent to "delete+rowid"
 
during an update - we have to generate undo equivalent to "update this rowid to have these before image values" (undo = rowid + column before images)
 
during a delete - we have to generate undo equivalent to "insert at this rowid these values"
 
so, considering an unindexed table - IN GENERAL, a delete and update will generate the most and an insert the least. IN GENERAL this is true (but not always).  
IN GENERAL=>delete>update>insert

if you add indexes - everything can change. the insert might generate gobs of undo for the index maintenance - the update might not update any indexed columns and hence only generate undo for the table - and the delete might have to maintain all of the indexes generating tons of undo again.
 
so, it depends on the nature of the data, what you are inserting/updating/deleting..
 
same for redo. It depends on what is modified...
 

Add indexes

IN GENERAL=>delete>insert>update

 

 

總結:

通常情況下

Undo 產生量排序:delete>update>insert

Undo(table of indexes) 產生量排序:delete>insert>update

一些手機傳送業務上,往往會使用update去更新業務的狀態!

 

轉載TOM的文章:


來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/26442936/viewspace-774756/,如需轉載,請註明出處,否則將追究法律責任。

相關文章