Try OpenEdge Now
skip to main content
ABL Database Triggers and Indexes
Database Index Usage : Searching without index
 

Searching without index

You can use the TABLE-SCAN option as an alternative to the USE-INDEX keyword in FOR EACH statements.
TABLE-SCAN provides the most efficient access method when retrieving all rows of a temp-table or a database table in a Type II Storage area. TABLE-SCAN returns these rows without using an index. When the TABLE-SCAN keyword is used, the AVM only accesses the record block instead of both record and index blocks.

Syntax

FOR EACH record ...[ USE-INDEX index | TABLE-SCAN ]
For a table in a Type I storage, the AVM uses the default index to perform the scan instead of TABLE-SCAN. If the QryInfo log entry is set, the AVM logs message when the TABLE-SCAN keyword is used on a Type I Storage area.
Note: The TABLE-SCAN keyword is not supported in any dynamic query statement and methods. For example, for the QUERY-PREPARE (“FOR EACHmytblTABLE-SCAN”) method a runtime error is raised, stating: “TABLE-SCAN option is not allowed in dynamic query”.
* When TABLE-SCAN is recommended instead of WHOLE-INDEX
* When TABLE-SCAN is not recommended to be used