Database Reference
In-Depth Information
Figure 15-4.
The query rewrite process
The following example, based on the
mv_rewrite.sql
script, shows general query rewrite in action. Notice that
the query is similar to the one used in the previous section to define the
sales_mv
materialized view. There are five
differences:
SELECT
clause is different. Note, however, that the materialized view contains all the
necessary data.
•
The
FROM
clause is written using the newer join syntax (notice the
JOIN
and
ON
keywords).
•
The
GROUP BY
clause is different. Data is aggregated on fewer columns (
country_id
is missing
•
The