The Transform hint under global hints tells the optimizer how to process or transform the entire query.
Hint name |
Explanation |
|---|---|
NO_QUERY_TRANSFORMATION |
Query rewriting is prohibited. |
NO_COST_BASED_QUERY_TRANSFORMATION |
Cost-based query rewrite is prohibited. |
NO_QUERY_TRANSFORMATION Hint
The NO_QUERY_TRANSFORMATION hint prohibits any query rewriting for the current query. Unlike the NO_REWRITE hint in query block hints, using NO_QUERY_TRANSFORMATION does not allow you to enable certain rewrites with query block hints.
For more information about query rewrite, see Overview.
Syntax
/*+ NO_QUERY_TRANSFORMATION */
Examples
--Use the `NO_QUERY_TRANSFORMATION` hint to prohibit any query rewrite.
SELECT /*+ NO_QUERY_TRANSFORMATION */ *
FROM (SELECT * FROM t1) v WHERE v.c1 = 3;
NO_COST_BASED_QUERY_TRANSFORMATION Hint
The NO_COST_BASED_QUERY_TRANSFORMATION hint prohibits any cost-based query rewriting for the current query. For more information about cost-based query rewriting, see Cost-based query rewriting.
Syntax
/*+ NO_COST_BASED_QUERY_TRANSFORMATION */
Examples
--Use the `NO_COST_BASED_QUERY_TRANSFORMATION` hint to prohibit any cost-based query rewrite.
CREATE TABLE t1(c1 int, c2 int, c3 int, index idx1(c1), index idx2(c2));
SELECT /*+ NO_COST_BASED_QUERY_TRANSFORMATION */ *
FROM t1
WHERE c1 = 1 OR c2 = 1;