An obvious query rewrite concern is instantiating virtual database objects and replacing specified query structures with more high-performing substitutes when possible.
For example, views referenced by a query must be resolved into their underlying base tables or covering indexes before the query can be performed. These rewrite methods also replace base tables and table joins with join or secondary indexes whenever the substitution improves query performance. These substitutions also apply to view materialization if base tables referenced by the view can be replaced profitably: Partial GROUP BY rewrites, and Common Spool Usage rewrites. The term materialized view describes database objects like snapshot summary tables and join indexes. For purposes of the current discussion, the term refers to materializing the base table components of a view definition in a spool relation.
These query rewrites are performed by the Optimizer subsystem after the Query Rewrite subsystem has completed its rewrite tasks.