Professional Documents
Culture Documents
Figure 4 Output From EXPLAIN REWRITE When Rewrite Is Possible
Figure 4 Output From EXPLAIN REWRITE When Rewrite Is Possible
In the next example, query rewrite is not possible so you will be advised why it cannot occur.
Figure 5 Output from EXPLAIN REWRITE when rewrite not possible
MESSAGE ----------------------------------------------------QSM-01082: Joining materialized view, COSTS_MV, with table, COSTS, not possible QSM-01102: materialized view, COSTS_MV, requires join back to table, COSTS, on column, PROD_ID
Now you can fix the materialized view yourself, or alternatively you could use the procedure QUICK_TUNE to show you how to create a materialized view to support this query.
Using QUICK_TUNE to recommend a materialized view for a query
If EXPLAIN_REWRITE advises that query rewrite is not possible, you may not be certain how to fix your materialized view to make query rewrite occur. The SQLAccess Advisor has been designed to tune a workload of SQL statements, and the Oracle Database 10g procedure QUICK_TUNE, is the single statement version of the SQLAccess Advisor, which recommends indexes and materialized views. It is very easy to use, simply supply a task name and the SQL state