Property | Description |
---|---|
Parameter type | String |
Syntax | QUERY_REWRITE_ENABLED = { false | true | force } |
Default value | If OPTIMIZER_FEATURES_ENABLE is set to 10.0.0 or higher, then true
If |
Modifiable | ALTER SESSION , ALTER SYSTEM |
Oracle RAC | Multiple instances can have different values. |
QUERY_REWRITE_ENABLED
allows you to enable or disable query rewriting globally for the database.
Values:
false
Oracle does not use rewrite.
true
Oracle costs the query with rewrite and without rewrite and chooses the method with the lower cost.
force
Oracle always uses rewrite and does not evaluate the cost before doing so. Use force
when 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 Performance Tuning Guide and "OPTIMIZER_MODE" for information on cost-based optimization