Databases Reference
In-Depth Information
on both the department table and employee table. Following the creation of the materi-
alized view, the database selects the access path shown on the right, which accesses both
the materialized view and its index, avoiding the costly table scan on the employee table.
The approximated cost for each plan is 24,305,758 versus 2,866.53 units, suggesting
the benefit from creating the materialized view and its index reduced the resource con-
sumption of this query by 99.99%.
If that resource consumption translates to execution time savings (a rough approxi-
mation, not always true) the query could now run 8.5 thousand times faster! However,
we aren't done with the design refinement. Even this new and dramatically improved
Figure 11.7
Query execution plan ( right ) and without ( left ) the materialized view.
Search WWH ::




Custom Search