ITPub博客

首页 > 数据库 > Oracle > Delete,insert,update与undo的关系[转载TOM文章]

Delete,insert,update与undo的关系[转载TOM文章]

原创 Oracle 作者:lovehewenyu 时间:2013-10-21 17:37:48 0 删除 编辑

Delete,insert,updateundo的关系

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的文章:

http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5663330700346736253


来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/26442936/viewspace-774756/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
Oracle,Mysql,EMC 存储,NBU备份

注册时间:2012-02-03

  • 博文量
    267
  • 访问量
    1295787