假设我有一个表和一个索引
original simple table A
------------------------
rowid | id name
123 | 1 A
124 | 4 G
125 | 2 R
126 | 3 P
index on A.id
-------------
id rowid
1 123
2 125
3 126
4 124
此时,我执行这个DML语句
UPDATE A SET id = 5 WHERE id = 4
执行此语句时会发生什么?
a)
BEGIN
go to index
search for `id == 4` (B tree index generally)
find that `rowid = 124`
go to that location
update id in the table
come back (? I am not sure)
update the index
END
b)
BEGIN
go to index
search for `id == 4` (B tree index generally)
update the id value in index
find that `rowid = 124`
go to that location
update id in the table
END
c)其他事情完全发生了
因为这可能依赖于数据库本身,
在甲骨文中是如何发生的?