oracle - is it safe to perform select by rowid -


i wonder safe use rowid row matching?

i have following query:

select * a,     (select a.rowid rid, <some_columns_omitted> a, b, c a.some_column = b.some_column ... <joining_omitted>      union      select a.rowid rid, <some_columns_omitted> a, d, e a.some_column = d.some_column ... <joining_omitted>      union ....) sub_query a.rowid = sub_query.rid 

will using rowid row matching safe using primary key?

see related question:

oracle guarantees that, long row exists, its rowid not change. rowid change in special occasions (table rebuild, partition table row movement enabled, index-organized table update pk). on heap tables, update not cause rowid change, if row migrated (because doesn't fit in block anymore).

in cases rowid part of metadata of row , kept consistent duration of query, same consistency mechanism keeps column data consistent (multiversion read consistency...).

furthermore, safe use rowid accross queries if lock row update (same primary key). accessing rows rowid faster primary key lookup (since primary key lookup index scan + rowid access).


Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -