Consultor Eletrônico



Kbase 21092: Row Identifiers, RECID and ROWID Explained
Autor   Progress Software Corporation - Progress
Acesso   Público
Publicação   17/07/2009
Status: Verified

GOAL:

Row Identifiers, RECID and ROWID, and how Progress can retrieve rows explained.

GOAL:

What is a Row Identifier?

GOAL:

What is a RECID?

GOAL:

What is a ROWID?

GOAL:

What is the default index?

GOAL:

How does Progress uses ROWID to retrieve records?

GOAL:

How does Progress uses RECID to retrieve records?

FACT(s) (Environment):

OpenEdge Category: Database
Progress 9.x
OpenEdge 10

FIX:

In order to understand how Progress retrieves rows, it is important to understand row identifiers and how they are used as part of an index. A "rowid" is a row identifier that uniquely encodes the exact disk location of a row within the database. In other words, each row in a database has one unique row identifier. As soon as a row is created, a row identifier is assigned to it and stays the same for the row's entire life. Even when the primary index key values are changed, the ROWID remains the same. Once a row is deleted, another row with the same identifier may be created. For Progress databases, RECIDs and ROWIDs are functionally equivalent but are different data types.

A RECID is essentially a 32-bit positive integer. It represents an encoding of the storage address of a record within a Progress database storage area.

A ROWID is a variable-length byte string whose semantics and length vary depending on the database type. For Progress databases, its meaning is the same a RECID. For the ORACLE DataServer, it is a representation of the ORACLE rowid.

When an index is added to a table, Progress automatically adds the row identifier as a component to the index. Even when no index is added to a table, Progress automatically creates a default primary index with the row identifier as its component.

In order for Progress to retrieve any row, it needs its row identifier. The following will explain the role of row identifiers and index selection criteria:

Before Progress can retrieve any row, it must first obtain its row identifier. Even for a sequential read of a table without a WHERE, BY, or USE-INDEX clause, Progress will obtain the row identifier of each of the rows using the primary index. Therefore sequential reading of a table involves reading the primary index sequentially, obtaining the row identifier, and then fetching the row using its row identifier. Using a specific row identifier to retrieve a row does not require the use of any index. A row identifier is a unique identifier for a row. It is used to directly retrieve a row without using any index. Using the USE-INDEX clause ensures that Progress will use the specified index. Only one index can be specified with a USE-INDEX clause.

In all other cases, Progress determines the indexes to be used at compile time, using the conditions specified in the WHERE or BY clauses.

ROWID Data Type -- is a direct pointer to a record in a Progress or DataServer database. This value is more DataServer-portable than a RECID value. For example:

FIND FIRST CUSTOMER WHERE ROWID(CUSTOMER) = cust-rowid-variable.
RECID Data Type -- is a direct pointer to a record in a Progress database and in some DataServer databases. For example:

FIND FIRST CUSTOMER WHERE RECID(CUSTOMER) = cust-recid-variable.


FIX:

References to Written Documentation:

Progress Solutions:

21091, "Index Management and Performance Considerations"
21093, "Index Cursors Explained"
21094, "Index Brackets Explained"
21095, "Row Retrieval Process Explained"
21096, "ROWID Record Retrieval Explained"
21097, "Using USE-INDEX Explained"
21098, "Single Index Selection Explained"
21099, "Multiple Index Selection Explained"
21100, "Using XREF Within Indexes Explained"