Each row in the database has an address. The rowid data type is used to store the address of a row in the database, including ROWID and UROWID. This topic provides an overview of the rowid data type.
ROWID data type
In the current version of OceanBase Database, the ROWID data type is logical. The ROWID of an index-organized table (IOT) is also logical.
You can query the pseudo column ROWID to check the row address. The value of this pseudo column is a string that represents the address of each row. The data type of this string is ROWID. You can also create a table that contains a column of the ROWID data type.
The ROWID data type is encoded in Base64.
The ROWID data type cannot be used directly. For more information, see ROWID pseudo column.
UROWID data type
Another type of rowid is Universal Rowid (UROWID). The UROWID data type supports logical ROWID.
Some rows in tables have nonphysical or nonpermanent addresses, or addresses that are not generated by OceanBase Database. For example, the row addresses of index-organized tables are stored in the index leaf nodes, which can be moved.
OceanBase Database uses the universal ROWID (UROWID) to store the addresses of index-organized tables. The ROWID of an index-organized table is logical, and the UROWID is stored in the ROWID pseudo column.
OceanBase Database creates a logical ROWID based on the primary key of a table. As long as the primary key remains unchanged, the logical ROWID will not change. The data type of the ROWID pseudo column of an index-organized table is UROWID. You can use the SELECT ... ROWID statement to access this pseudo column. If you want to store the ROWID of an index-organized table, you can define a column of the UROWID data type for the table and retrieve the value of the ROWID pseudo column into this column.
