Progress
DataServer
for ODBC Guide


Indexes

You create and maintain all indexes from within the ODBC data source, using native data-source tools rather than with the Progress Data Dictionary. A data-source index uses a logical pointer to the physical locations of table rows in order to sequence data access. You can add and drop indexes but you cannot use their names in queries. The data source alone ultimately decides when and how to use indexes; its decisions are not affected by the DataServer.

Using index definitions in the ODBC data source, the DataServer builds index information in the schema holder. Progress index definitions for the data source schema serve two purposes:

Dummy Indexes for Sort Order

You can add dummy index definitions to your schema holder independent of the actual index definitions in your ODBC data source to provide a sort order. These dummy indexes can improve the readability of your Progress 4GL code. An index in the schema holder need not match an index in the ODBC data source. However, the absence of an index definition in the data source can impact performance when you retrieve data with selection on the dummy indexes.

Unique Indexes

If your ODBC data-source tables have at least one unique index, they can be used to support operations such as backward and forward scrolling and accurate cursor positioning through the FIND CURRENT, PREV, and LAST statements. If a table does not have a unique index, you can scroll only forward through its data.

If an ODBC data-source table does not have a unique index, you can designate an index to serve as the unique index for the schema holder. An index that you designate as unique in the schema holder must be unique with respect to the data in the data source, otherwise you receive run-time errors. See "The DataServer Tutorial," for instructions on using the Progress Data Dictionary to designate unique indexes.

ODBC data-source views and result sets from stored procedures do not have unique indexes. Just as for tables, you can use the Progress Data Dictionary to create a unique index in the schema holder based on fields in a view or result set so that you can browse data accessed through views or stored procedures.

NOTE: Do not change the designated ROWID key of a record while an application is running. Suppose, for example, that cust-num is a unique key and has been designated the Progress ROWID. If a user changes the value of cust-num for a customer from 1 to 111, other users receive an error message when they try to access the record for customer 1.


Copyright © 2004 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095