OR transformations If all the OR predicates in a WHERE clause have a particular form, they might be optimizable. OR transformations Internal transformation of statementsOR predicates

Specifically, if all the OR predicates in a WHERE clause are of the form

simple column reference = Expression

where the columnReference is the same for all predicates in the OR chain, transforms the OR chain into an IN list of the following form:

simple column reference IN (Expression1, Expression2, ..., ExpressionN)

The new predicate might be optimizable.

For example, can transform the following statement:

SELECT * FROM Flights WHERE flight_id = 'AA1111' OR flight_id = 'US5555' OR flight_id = ?

into this one:

SELECT * FROM Flights WHERE flight_id IN ('AA1111', 'US5555', ?)

If this transformed IN list is a static IN list, also performs the static IN list transformation (see ).