Java DB

Apache Derby

Derby Performance Tuning

Derby Getting Started
Derby Reference Manual
Derby Developer's Guide
Derby Performance Tuning
Derby Server and Admin Guide
Derby Tools and Utilities
Derby Performance Tuning
-Performance tips and tricks
-Tuning databases and applications
-DML statements and performance
-Performance and optimization
-Locking and performance
-Non-cost-based optimizations
-Overriding the default optimizer behavior
-Selectivity and cardinality statistics
-Internal language transformations
-Predicate transformations
-Transitive closure
-View transformations
-Subquery processing and transformations
-Outer join transformations
-Sort avoidance
-Aggregate processing
-

 

OR transformations

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, Derby 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, Derby 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, Derby also performs the static IN list transformation (see Simple IN predicate transformations).

 

javadb@jdbcurl.com