How is the UPDATE table handled by the RDBMS?

Suppose I have a table and an index on it

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

At this moment I execute this DML statement

UPDATE A SET id = 5 WHERE id = 4

What exactly happens when this statement is executed?

and)

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) Something else is happening completely

Since this may depend on the database itself, how does this happen in Oracle?

+5
source share
2 answers

From: http://jonathanlewis.wordpress.com/2006/11/22/tuning-updates/

" Oracle (B-tree) , (B-tree) , ( rowids) "

, / -. ( DBA_EXTENTS) , , , .

, , .

+1

:

  • PL/SQL
  • tkprof
0

All Articles