
11.2
How the Optimizer Rewrites Queries 321
Chapter 11
more complex a query, the less likely the optimizer will be able to match
with a materialized view. The optimizer can only go so far.
More generally, and most sensibly, the optimizer should always select the
smallest materialized view for query rewrite. In other words, if there are
multiple layers of materialized views organized in a hierarchy then the most
aggregated materialized view will be selected based on requiring the smallest
amount of work.
11.2 How the Optimizer Rewrites Queries
This section analyzes query rewrite methods and checks made by the opti-
mizer, followed by some special cases, ...