Guidelines for implementation

An access method might create a row from each source record and pass the row to the database server for evaluation. However, each call to mi_row_create() to format a row or to mi_eval_am_qual() to have the database server evaluate the row can reduce performance. A developer might use this simple approach for low-volume data.

If possible, an access method evaluates the entire WHERE clause to eliminate unqualified source records. For each candidate record that it cannot disqualify, the access method calls mi_row_create() and mi_eval_am_qual() functions, which causes the database server to enter any missing results in the qualification descriptor. For an example of this approach, see Process complex qualifications.

Ideally, the access method only formats values that the query projects and fills the remaining columns with NULL values. To determine which columns contain the values that the query requires, the access method calls the mi_scan_nprojs() and mi_scan_projs() functions.