



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




After optimizing using a materialized view :
section shows several complex join conditions (e.g., "IDSHOW"="E"."IDSHOW", "IDSTAFF"="P"."IDSTAFF") that would benefit from appropriate indexes. Optimized Query Analysis: ● Hash joins with HASH JOIN operations (ids 2, 3, 4) ● Multiple full table scans (STAFF: 1048K rows, PRINCIPALS: 1048K rows, EPISODE: 1048K rows) ● Lower cost of 10338 compared to previous query (19778) ● Materialized view operations (operations 5-7) ● Adaptive plan usage noted at bottom Comparison with Previous Plan: ● This plan is more efficient (10338 vs 19778 cost) ● Uses materialized view access (MV_SHOW_RATINGS) rather than joining raw tables. ● More efficient use of memory (27M bytes vs 1107M bytes) ● Better join organization with fewer hash joins Possible Improvements: ● partitioning large tables like STAFF and EPISODE ● Add bitmap indexes for frequently filtered columns Query 2: Before optimizing
After optimizing using a materialized view
Optimization Method Cost Plan Depth Full Table Scans Complexity Original Query 1839 16 levels Multiple High Materialized View 2 1 level 1 (on small MV) Very Low Best Optimization Method
● 99.9% cost reduction compared to the original query ● Elimination of all complex joins and aggregations at runtime ● Simplest execution plan with just a single operation
Conclusion