Optimizer Overrides
Page 4 of 6

index

Function

The Cloudscape optimizer chooses an index, including the indexes that enforce constraints, as the access path for query execution if it is useful. If there is more than one useful index, in most cases Cloudscape chooses the index that is most useful.

You can override the optimizer's selection and force use of a particular index or force a table scan. To force use of a particular index, specify the unqualified index name. To force a table scan, specify null for the index name.

See also constraint.

System-generated index names use lowercase letters, so you must treat them as delimited identifiers and enclose them in double quotation marks.

NOTE: An exception is thrown if the access path is nonexistent or invalid. The optimizer cannot use an index if the statement is an updatable cursor whose updatable columns are in the index's key, or if the statement is an UPDATE statement and the updated columns are in the index's key.

Syntax

index= { indexName | null }

Example

See the example under constraint.

Scope

Table optimizer-override property.