dml操作谁产生的undo最多

During which DML operation ( Insert,update and delete) which is the most undo and redo generated and why.
Tom said...
it depends :)
all you have to do however is think about what happens during each operation under different conditions - then you can sort of guestimate what will happen.
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).
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...
 

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

转载于:http://blog.itpub.net/28278387/viewspace-749161/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
MySQL的DML操作命令主要包括INSERT、SELECT、UPDATE和DELETE。INSERT用于向表中插入新的数据,语法格式为: INSERT INTO 表名 [ ( 字段1, 字段2, 字段3, … ) ] VALUES ( ‘值1’, ‘值2’, ‘值3’, …)。 SELECT用于查询表中的数据,并返回所需的结果集,语法格式为: SELECT 列名 FROM 表名 WHERE 条件。 UPDATE用于修改表中已有的数据,语法格式为: UPDATE 表名 SET 列名 = 值 WHERE 条件。 DELETE用于删除表中的数据,语法格式为: DELETE FROM 表名 WHERE 条件。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [MySQL之DML常用命令](https://blog.csdn.net/qq_46337973/article/details/120089677)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [MySQL基础—数据库操作](https://download.csdn.net/download/weixin_38667697/13685425)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [MySQL的使用-DML操作](https://blog.csdn.net/baidu_41211699/article/details/106544920)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值