Background documentationSearch Conditions Locate this document in the navigation structure

 

The SQL Optimizer can only optimize data access for those SQL statements that contain a search condition. A search condition is defined with a WHERE clause.

Example Example

SELECT name

  FROM customer

    WHERE cno = 7020

End of the example.

You can specify a search condition for the following types of SQL statements:

  • SELECT

  • UPDATE

  • DELETE

  • INSERT

The form of the search condition has a significant effect on the costs incurred by executing the SQL statement. The SQL Optimizer only takes into account the following search conditions:

Caution Caution

Restrictions apply for UPDATE statements. See Restrictions for UPDATE statements.

End of the caution.

If the SQL Optimizer cannot transform the search conditions in an SQL statement into one of the forms listed above, it cannot determine a search strategy for them and uses the sequential search instead. If search conditions are linked using a number of identical boolean operators, the sequence of these conditions does not affect how the SQL Optimizer determines the search strategy.