Progress/400
Product Guide


Field Lists

Progress/400 supports field lists. Field lists can improve performance because the entire record is not returned to the client. Progress returns only the requested fields. However, using field lists in a query does not automatically ensure performance improvements. The following list explains what field lists can do and where they are appropriate:

These factors influence performance when using field list queries:

Progress/400 provides the same support for both a DB2/400 database and a Progress database when using field list queries. The following example returns the same result for both a Progress database and a DB2/400 database:

DEFINE QUERY myquery FOR customer FIELDS (cust-num name) SCROLLING. 

Include the SCROLLING option to enable record prefetch. You must include the NO-LOCK option when you open queries with field lists, as in the following example:

OPEN QUERY myquery NO-LOCK. 

Similarly, you must include the NO-LOCK option in FOR EACH statements that include field lists, as in the following example:

FOR EACH customer FIELDS (cust-num name) NO-LOCK: 

Alternatively, you can tune the database to have NO-LOCK as the default. This allows you to use field lists without specifying the NO-LOCK query option.

Use field lists to retrieve only those fields that your application requires. (For performance reasons, the Progress/400 DataServer retrieves the first index field even when you do not include it in the field list. In cases when the DataServer can predict that a query requires a refetch, it retrieves the entire record.) The DataServer allocates memory based on the maximum size specified for a field in a record. Omitting larger fields from a query enhances performance.

When the DataServer processes a query with a field list, it caches the fields that are part of the field list and any other fields that the query specified, which you can then access without making another call to the DB2/400 RDBMS. For example, the Progress/400 DataServer fetches the name and the zip field to process the following query:

FOR EACH customer FIELDS (name) WHERE zip = 01730 NO-LOCK: 

See the Record Phrase entry in the Progress Language Reference for more information on the FIELDS option.


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