1.297 QUERY_REWRITE_ENABLED
Use QUERY_REWRITE_ENABLED to enable or disable query rewriting globally for the database.
| Property | Description |
|---|---|
|
Parameter type |
String |
|
Syntax |
|
|
Default value |
If If |
|
Modifiable |
|
|
Modifiable in a PDB |
Yes |
|
Basic |
No |
|
Oracle RAC |
Multiple instances can have different values. |
Values
-
falseOracle does not use rewrite.
-
trueOracle costs the query with rewrite and without rewrite and chooses the method with the lower cost.
-
forceOracle always uses rewrite and does not evaluate the cost before doing so. Use
forcewhen you know that the query will always benefit from rewrite and when reduction in compile time is important.
To take advantage of query rewrite for a particular materialized view, you must enable query rewrite for that materialized view, and you must enable cost-based optimization.
See Also:
-
Oracle Database Data Warehousing Guide for information on query rewrite of materialized views
-
Oracle Database SQL Tuning Guide and "OPTIMIZER_MODE" for information on cost-based optimization