Search Conditions

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.

SELECT name FROM customer
  WHERE cno = 7020

You can specify a search condition for the following SQL statement types: SELECT, UPDATE, DELETE, INSERT.

Some search condition restrictions apply to UPDATE statements.

The form of the search condition has a significant effect on the costs incurred by executing the SQL statement. When determining costs for an SQL statement, the SQL Optimizer only considers the following search conditions:

Equality Condition

Range Condition

IN Condition

LIKE Condition

If the search conditions in an SQL statement cannot be transformed into one of the forms listed above, the SQL Optimizer 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.

See also:

Search Strategies

SQL Optimizer Procedure

SQL Reference Manual, Table Expression (table_expression)