Alon Y. Levy , Inderpal Singh Mumick , Yehoshua Sagiv , Query Optimization by Predicate Move-around Proceedings of the 20th VLDB Conference, Santiago, Chile 1994
Abstract: A new type of optimization for SQL queries, called predicate
move-around, is introduced. It is shown how this optimization
considerably improves the efficiency of evaluating SQL queries,
especially queries that have query graphs with a large number of query
blocks (which is a typical situation when queries are defined in terms
of multiple views and subqueries). Predicate move-around is a
generalization of and has many advantages over the traditional
predicate pushdown. One key advantage is that predicate move-around
precedes pushdown by pulling predicates up the query graph. As a
result, predicates that appear in the query in one part of the graph
can be moved around the graph and applied also in other parts of
graph. Moreover, predicate move-around optimization can move a wider
class of predicates in a wider class of queries as compared to the
standard predicate-pushdown techniques. In addition to the usual
comparison and arithmetic predicates, other predicates that can be
moved around are the EXISTS and NOT EXISTS
clauses, the
EXCEPT clause, and functional dependencies. The proposed
optimization can also move predicates through aggregation and across
query blocks (in the query graph) that cannot be merged into one
block. Moreover, the method can also infer new predicates when
existing predicates are moved through aggregation or when certain
functional dependencies are known to hold. Finally, the predicate
move-around algorithm is easy to implement on top of existing query
optimizers.