Delete,insert,update與undo的關係[轉載TOM文章]
Delete,insert,update 與undo的關係
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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 34、VIEW可以insert,delete,update.Viewdelete
- sql server 帶有OUTPUT的INSERT,DELETE,UPDATESQLServerdelete
- Default Locking for INSERT, UPDATE, DELETE, and SELECT ... FOR UPDATE (351)delete
- myisam對於update,insert,delete關於auto_incremant的影響deleteREM
- innodb對於update,insert,delete關於auto_incremant的影響deleteREM
- mysql innodb新建索引堵塞update ,insert,deleteMySql索引delete
- mysql 在delete、insert、update 時,page的變化MySqldelete
- MySQL之資料的insert-delete-update操作MySqldelete
- 模擬insert,update和delete造成阻塞的示例delete
- SQLite語句(二):INSERT DELETE UPDATE SELECTSQLitedelete
- MongoDB入門系列(二):Insert、Update、Delete、DropMongoDBdelete
- 利用insert,update和delete注入獲取資料delete
- MERGE新特性(UPDATE WHERE,DELETE WHERE,INSERT WHERE)delete
- LINQ to SQL語句之Insert/Update/Delete操作SQLdelete
- Oracle資料庫中Insert、Update、Delete操作速度Oracle資料庫delete
- DBeaver如何生成select,update,delete,insert語句delete
- select for update與autocommit關係MIT
- KunlunDB功能之insert/update/delete...returning語句delete
- 索引是否也能提高UPDATE,DELETE,INSERT速度 解釋索引delete
- SQL Server的Merge —— 一步實現 insert,update,deleteSQLServerdelete
- Sqlserver update\delete用inner join關聯,會update\delete關鍵字後面的表關聯到的行SQLServerdelete
- 輕量ORM-SqlRepoEx (四)INSERT、UPDATE、DELETE 語句ORMSQLdelete
- 【轉載】SCN 備份與恢復的關係
- java-Mybatis XML 對映器(select,insert, update 和 delete)JavaMyBatisXMLdelete
- MySQL 4.1.0 中文參考手冊 --- 6.4 資料操縱:SELECT, INSERT, UPDATE, DELETE (轉)MySqldelete
- 檢視insert,delete,update對基表的影響(檢視初識)delete
- HWM和delete,drop,truncate的關係delete
- 【MyBatis原始碼分析】insert方法、update方法、delete方法處理流程(上篇)MyBatis原始碼delete
- 【MyBatis原始碼分析】insert方法、update方法、delete方法處理流程(下篇)MyBatis原始碼delete
- 品牌關係管理(轉載)
- 互惠關係定律(轉載)
- MySQL 關於 INSERT INTO...ON DUPLICATE KEY UPDATE 的使用MySql
- repo和Git的關係 [轉載]Git
- UPDATE操作和UNDO
- 如何插入insert_update,delete_select特殊字元&到oracle表中delete字元Oracle
- Handler_delete和Com_delete有什麼關係delete
- 論Asp與XML的關係(轉)XML
- apache與 tomcat 搭建https及其關係ApacheTomcatHTTP