Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>From the <a href="http://download.oracle.com/docs/cd/B19306_01/server.102/b14220/datatype.htm#i8776" rel="noreferrer">concept guide</a>:</p> <blockquote> <p>Physical rowids provide the fastest possible access to a row of a given table. They contain the physical address of a row (down to the specific block) and allow you to retrieve the row in a single block access. Oracle guarantees that as long as the row exists, its rowid does not change.</p> </blockquote> <p>The main drawback of a ROWID is that while it is normally stable, it can change under some circumstances:</p> <ul> <li>The table is rebuilt (<code>ALTER TABLE MOVE</code>...)</li> <li>Export / Import obviously</li> <li>Partition table with row movement enable</li> </ul> <p>A primary key identifies a row <em>logically</em>, you will always find the correct row, even after a delete+insert. A ROWID identifies the row <em>physically</em> and is not as persistent as a primary key. </p> <p>You can safely use ROWID in a single SQL statement since Oracle will guarantee the result is coherent, for example to remove duplicates in a table. To be on the safe side, I would suggest you only use the ROWID <em>accross statements</em> when you have a lock on the row (SELECT ... FOR UPDATE). </p> <p>From a performance point of view, the Primary key access is a bit more expensive but you will normally notice this only if you do a lot of single row access. If performance is critical though, you usually can get greater benefit in that case from using set processing than single row processing with rowid. In particular, if there are a lot of roundtrips between the DB and the application, the cost of the row access will probably be negligible compared to the roundtrips cost.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload