Entering content frame

 Search Conditions 

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

SELECT name

FROM customer

WHERE city = 'Berlin' AND zip > 13000

The following SQL key words can be combined with a search condition: SELECT, UPDATE, DELETE, INSERT.

Some restrictions for search conditions apply to UPDATE statements.

The form of the search condition has a significant effect on the costs incurred by the execution of the SQL statement. When it determines costs for an SQL statement, the 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 converted into one of the forms listed above, then the Optimizer cannot determine a search strategy for them.

If search conditions are linked using multiple identical Boolean operators, then the sequence of the search conditions does not have any influence on how the search strategy is determined by the Optimizer.

 

Leaving content frame