# Oracle的伪列

A、ROWID
B、ROW_NUMBER()
C、LEVEL
D、ROWNUM
E、COLUMN

pseudocolumn behaves like a table column, but is not actually stored in the table. You can select from pseudocolumns, but you cannot insert, update, or delete their values. A pseudocolumn is also similar to a function without arguments . However, functions without arguments typically return the same value for every row in the result set, whereas pseudocolumns typically return a different value for each row.

Hierarchical Query Pseudocolumns
Sequence Pseudocolumns
Version Query Pseudocolumns
COLUMN_VALUE Pseudocolumn
OBJECT_ID Pseudocolumn
OBJECT_VALUE Pseudocolumn
ORA_ROWSCN Pseudocolumn
ROWID Pseudocolumn
ROWNUM Pseudocolumn
XMLDATA Pseudocolumn

ROWID Pseudocolumn

For each row in the database, the ROWID pseudocolumn returns the address of the row. Oracle Database rowid values contain information necessary to locate a row:

The data object number of the object

The data block in the data file in which the row resides

The position of the row in the data block (first row is 0)

The data file in which the row resides (first file is 1). The file number is relative to the tablespace.

Usually, a rowid value uniquely identifies a row in the database. However, rows in different tables that are stored together in the same cluster can have the same rowid.

Values of the ROWID pseudocolumn have the data type ROWID or UROWID. Refer to "Rowid Data Types" and "UROWID Data Type" for more information.

Rowid values have several important uses:

They are the fastest way to access a single row.
They can show you how the rows in a table are stored.
They are unique identifiers for rows in a table.

You should not use ROWID as the primary key of a table. If you delete and reinsert a row with the Import and Export utilities, for example, then its rowid may change. If you delete a row, then Oracle may reassign its rowid to a new row inserted later.

Although you can use the ROWID pseudocolumn in the SELECT and WHERE clause of a query, these pseudocolumn values are not actually stored in the database. You cannot insert, update, or delete a value of the ROWID pseudocolumn.

(尽管你可以在SELECT..WHERE..查询语句中得到ROWID，但是该列的值并不是实际存储在数据库当中的，你不能够插入、修改或者删除ROWID伪列的值)

1、感觉在调优计划中ACCESS BY INDEX ROWID的速度是最快的，那么经验盒子告诉我，ROWID极有可能是存在数据块中的。
2、在数据块BLOCK的结构中，存在数据块头、表目录区、行目录区、可用空间区一级行数据区。不求甚解，理所当然认为行目录区中存放的就是ROWID的信息。现在回想一下，应该是存放了ROWID的部分相关信息，例如应该保存的是类似于C语言中的物理地址信息，而不是我们可见的形如ROWID的信息。