Oracle Hints Version 19c |
---|
General Information | ||||||||||||||||||||
Library Note |
|
|||||||||||||||||||
Note | The demos on this page are intended to show valid syntax but it is far easier to use a hint to make a mess of things than it is to improve things.
So many, if not most, of the demos here are written intentionally to show that they can increase the cost. Before you proceed read everything in this General Information section. Warning: Before you use this page, or any hint, it is critically important that you understand what you are about to do. The simple overriding fact is that Oracle Corp. has not documented the vast majority of hints and for those they have documented the documentation is wholly inadequate and often misleading or incomplete. Some of the worst SQL I have ever seen has been bad not because it was terribly written from the standpoint of syntax but rather it was written by someone with less than a whole clue about how the hints they embedded into that SQL that they likely found in some nonsense on the internet that referred to a previous version or a version that never existed except in their dreams. In an attempt to educate my readers I am providing this link to Jonathan Lewis' "Rules for Hinting" https://jonathanlewis.wordpress.com/2008/05/02/rules-for-hinting/ as well as the following screen shot in case Jonathan ever does a house cleaning and removes the page. If you think you know more about proper use of hints than Jonathan seek professional help from a board certified psychotherapist. Advice I gladly provide to almost everyone that has used a hint in an example posted on the web. |
|||||||||||||||||||
![]() |
||||||||||||||||||||
Hint Sections |
|
|||||||||||||||||||
Data Dictionary Objects |
|
|||||||||||||||||||
Dictionary Demo | col sql_feature format a35 |
|||||||||||||||||||
Fully Hinting comment by Jonathan Lewis on USENET |
Consider, for example:SELECT /*+ index(t1 t1_abc) index(t2 t2_abc) */ COUNT(*) For weeks, this may give you the plan: NESTED LOOP Then, because of changes in statistics, or init.ora parameters, or nullity of a column, or a few other situations that may have slipped my mind at the moment, this might change to: HASH JOIN Your hints are still obeyed, the plan has changed. On the other hand, if you had specified: SELECT /*+ no_parallel(t1) no_parallel(t2) no_parallel_index(t1) no_parallel_index(t2) Then I think you could be fairly confident that there was no way that Oracle could obey the hints whilst changing the access path. Morgan's comment: Of course the above would only be true in the specific version Jonathan was thinking about when he wrote his statement. Try it in another version and all bets are off. |
|||||||||||||||||||
Access Method Hints (Cluster) | ||||||||||||||||||||
Each following hints described in this section suggests an access method for a cluster. | ||||||||||||||||||||
CLUSTER Documented |
Explicitly requests a nested loop of the cluster index of one of the tables in the cluster. | |||||||||||||||||||
/* CLUSTER([@queryblock] <tablespec>) */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
CLUSTERING Documented |
Valid only for INSERT and MERGE operations on tables that are enabled for attribute clustering. The CLUSTERING hint enables attribute clustering for direct-path inserts (serial or parallel). This results in partially-clustered data, that is, data that is clustered per each insert or merge operation. This hint overrides a NO ON LOAD setting in the DDL that created or altered the table. | |||||||||||||||||||
/*+ CLUSTERING */ |
||||||||||||||||||||
TBD |
||||||||||||||||||||
HASH Documented |
Explicitly chooses a hash scan to access the specified table. Only applies to hash clusters. | |||||||||||||||||||
/*+ HASH(<tablespec>) */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
NO_CLUSTERING Documented |
valid only for INSERT and MERGE operations on tables that are enabled for attribute clustering. The NO_CLUSTERING hint disables attribute clustering for direct-path inserts (serial or parallel). This hint overrides a YES ON LOAD setting in the DDL that created or altered the table. | |||||||||||||||||||
/*+ NO_CLUSTERING */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
Access Method Hints (Table) | ||||||||||||||||||||
With the exception of the first two listings, each following hints described in this section suggests an access method for a table. | ||||||||||||||||||||
AND_EQUAL | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
BITMAP_TREE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
FULL Documented |
Explicitly chooses a full table scan for the specified table. | |||||||||||||||||||
/*+ FULL(<tablespec>) */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
INDEX Documented |
Explicitly chooses an index scan for the specified table. You can use the INDEX hint for domain, B*-tree, and bitmap indexes. Oracle recommends using INDEX_COMBINE rather than INDEX for bitmap indexes because it is a more versatile hint. | |||||||||||||||||||
/*+ INDEX([@queryblock] <tablespec> <index_name>) */ |
||||||||||||||||||||
conn oe/oe@pdbdev |
||||||||||||||||||||
INDEX_ASC Documented |
Explicitly chooses an index scan for the specified table. If the statement uses an index range scan, Oracle scans the index entries in ascending order of their indexed values. | |||||||||||||||||||
/*+ INDEX_ASC([@queryblock] <tablespec> <index_name>) */ |
||||||||||||||||||||
See INDEX Demo Above | ||||||||||||||||||||
INDEX_COMBINE Documented |
Explicitly chooses a bitmap access path for the table. If no indexes are given as arguments for the INDEX_COMBINE hint, the optimizer uses whatever Boolean combination of bitmap indexes has the best cost estimate for the table. If certain indexes are given as arguments, the optimizer tries to use some Boolean combination of those particular bitmap indexes. | |||||||||||||||||||
/*+ INDEX_DESC([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
conn hr/hr@pdbdev |
||||||||||||||||||||
INDEX_DESC Documented |
Explicitly chooses an index scan for the specified table. If the statement uses an index range scan, Oracle scans the index entries in descending order of their indexed values. | |||||||||||||||||||
/*+ INDEX_DESC([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
See INDEX Demo Above | ||||||||||||||||||||
INDEX_FFS Documented |
Causes a fast full index scan rather than a full table scan. Appears to be identical to INDEX_FFS_ASC. | |||||||||||||||||||
/*+ INDEX_FFS([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
See INDEX SCAN Demos Below | ||||||||||||||||||||
INDEX_JOIN Documented |
Explicitly instructs the optimizer to use an index join as an access path. For the hint to have a positive effect, a sufficiently small number of indexes must exist that contain all the columns required to resolve the query. | |||||||||||||||||||
/*+ INDEX_JOIN([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
conn oe/oe@pdbdev |
||||||||||||||||||||
INDEX_RS Undocumented |
Instructs the optimizer to perform an index range scan for the specified table. | |||||||||||||||||||
/*+ INDEX_RS([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
INDEX_RS_ASC Undocumented |
Instructs the optimizer to perform an index range scan for the specified table. | |||||||||||||||||||
/*+ INDEX_RS([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
INDEX_RS_DESC Undocumented |
Instructs the optimizer to perform an index range scan for the specified table. | |||||||||||||||||||
/*+ INDEX_RS([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
conn oe/oe@pdbdev |
||||||||||||||||||||
INDEX_SS Documented |
Instructs the optimizer to perform an index skip scan for the specified table. If the statement uses an index range scan, then Oracle scans the index entries in ascending order of their indexed values. In a partitioned index, the results are in ascending order within each partition. | |||||||||||||||||||
/*+ INDEX_SS([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
See INDEX SCAN Demos Below | ||||||||||||||||||||
INDEX_SS_ASC Documented |
Instructs the optimizer to perform an index skip scan for the specified table. If the statement uses an index range scan, then Oracle Database scans the index entries in ascending order of their indexed values.
In a partitioned index, the results are in ascending order within each partition. Each parameter serves the same purpose as in "INDEX Hint". The default behavior for a range scan is to scan index entries in ascending order of their indexed values, or in descending order for a descending index. This hint does not change the default order of the index, and therefore does not specify anything more than the INDEX_SS hint. However, you can use the INDEX_SS_ASC hint to specify ascending range scans explicitly should the default behavior change. |
|||||||||||||||||||
/*+ INDEX_SS_ASC([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
See INDEX SCAN Demos Below | ||||||||||||||||||||
INDEX_SS_DESC Documented |
Instructs the optimizer to perform an index skip scan for the specified table. If the statement uses an index range scan and the index is ascending, then Oracle scans the index entries in descending order of their indexed values. In a partitioned index, the results are in descending order within each partition. For a descending index, this hint effectively cancels out the descending order, resulting in a scan of the index entries in ascending order. | |||||||||||||||||||
/*+ INDEX_SS_DESC([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
See INDEX SCAN Demos Below | ||||||||||||||||||||
NLJ_BATCHING | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NLJ_PREFETCH | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_INDEX Documented |
Explicitly disallows a set of indexes for the specified table. The NO_INDEX hint applies to function-based, B*tree, bitmap, cluster, or domain indexes. | |||||||||||||||||||
/*+ NO_INDEX([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
NO_INDEX_FFS Documented |
Instructs the optimizer to exclude a fast full index scan of the specified indexes. | |||||||||||||||||||
/*+ NO_INDEX_FFS([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
NO_INDEX_RS | Undocumented: Instructs the optimizer to exclude an index range scan of the specified indexes. | |||||||||||||||||||
/*+ NO_INDEX_RS([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
conn hr/hr@pdbdev |
||||||||||||||||||||
NO_INDEX_SS Documented |
Instructs the optimizer to exclude a skip scan of the specified indexes. | |||||||||||||||||||
/*+ NO_INDEX_SS([@queryblock] <tablespec> <indexspec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_NLJ_BATCHING | Undocumented but clearly related to No Nested Loop Batching | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_NLJ_PREFETCH | Undocumented but clearly related to No Nested Loop Join Prefetch | |||||||||||||||||||
TBD | ||||||||||||||||||||
Index Scan Demos Also see the link at page bottom |
conn hr/hr@pdbdev |
|||||||||||||||||||
Adaptive Plan Hints | ||||||||||||||||||||
ADAPTIVE_PLAN | /*+ ADAPTIVE_PLAN */ |
|||||||||||||||||||
TBD | ||||||||||||||||||||
NO_ADAPTIVE_PLAN | /*+ NO_ADAPTIVE_PLAN */ |
|||||||||||||||||||
TBD | ||||||||||||||||||||
Append Hints | ||||||||||||||||||||
APPEND and NOAPPEND Documented |
Instructs the optimizer to use direct-path INSERT if your database is running in serial mode. Your database is in serial mode if you are not using Enterprise Edition.
Conventional INSERT is the default in serial mode, and direct-path INSERT is the default in parallel mode. In direct-path INSERT, data is appended to the end of the table, rather than using existing space currently allocated to the table. As a result, direct-path INSERT can be considerably faster than conventional INSERT. When you use the APPEND hint for INSERT, data is simply appended to a table above the HWM which has the effect of not creating UNDO. Existing free space in blocks is not used. |
|||||||||||||||||||
/*+ APPEND */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
APPEND_VALUES Documented |
Forces the optimizer to use direct-path INSERT with the VALUES clause. If you do not specify this hint, then conventional INSERT is used. This hint is only supported with the VALUES clause of the INSERT statement. If you specify it with an insert that uses the subquery syntax it is ignored. | |||||||||||||||||||
/*+ APPEND_VALUES */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
NOAPPEND Documented |
/*+ NOAPPEND */ |
|||||||||||||||||||
TBD | ||||||||||||||||||||
Bind Aware | ||||||||||||||||||||
These two undocumented hints relate to the awareness, in cursor sharing, of the value(s) bound to the cursor through bind variables | ||||||||||||||||||||
BIND_AWARE | /*+ BIND_AWARE */ |
|||||||||||||||||||
TBD | ||||||||||||||||||||
NO_BIND_AWARE | /*+ NO_BIND_AWARE */ |
|||||||||||||||||||
TBD | ||||||||||||||||||||
Cache Hints | ||||||||||||||||||||
AV_CACHE New: 18.1 |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
CACHE Documented |
Instructs the optimizer to place the blocks retrieved for the table at the most recently used end of the LRU list in the buffer cache when a full table scan is performed. This hint is useful for small lookup tables. | |||||||||||||||||||
/*+ CACHE([@queryblock] <tablespec>) */ |
||||||||||||||||||||
conn hr/hr@pdbdev |
||||||||||||||||||||
CACHE_TEMP_TABLE | /*+ CACHE_TEMP_TABLE */ |
|||||||||||||||||||
TBD | ||||||||||||||||||||
NOCACHE Documented |
Specifies that the blocks retrieved for this table are placed at the least recently used end of the LRU list in the buffer cache when a full table scan is performed. This is the normal behavior of blocks in the buffer cache. | |||||||||||||||||||
/*+ NOCACHE([@queryblock] <tablespec>]) */ |
||||||||||||||||||||
See CACHE Demo Above | ||||||||||||||||||||
Container Database Hints | ||||||||||||||||||||
CONTAINERS Documented |
Use in a SELECT statement in a multitenant container database (CDB) to specify that the statement contains the CONTAINERS() clause. Such a statement lets you query data in the specified table or view across all containers in a CDB or application container. | |||||||||||||||||||
/*+ CONTAINERS (DEFAULT_PDB_HINT = '<hint'>') */ |
||||||||||||||||||||
SELECT /*+ CONTAINERS(DEFAULT_PDB_HINT='NO_PARALLEL') */ ( |
||||||||||||||||||||
PDB_LOCAL_ONLY | Undocumented |
|||||||||||||||||||
TBD | ||||||||||||||||||||
Cost Based Optimizer Hints | ||||||||||||||||||||
BITMAP | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
BUFFER | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
BYPASS_UJVC | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
CACHE_CB | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
CLUSTER_BY_ROWID and NO_CLUSTER_BY_ROWID |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
CUBE_GB | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
DML_UPDATE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
DOMAIN_INDEX_FILTER | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
DOMAIN_INDEX_NO_SORT | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
DOMAIN_INDEX_SORT | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
EXPR_CORR_CHECK | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
FBTSCAN | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
FULL_OUTER_JOIN_TO_OUTER and NO_FULL_OUTER_JOIN_TO_OUTER |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
HWM_BROKERED | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
INDEX_RRS | Undocumented: Internal hint that can only be inserted by the optimizer | |||||||||||||||||||
TBD | ||||||||||||||||||||
LOCAL_INDEXES | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
MERGE_CONST_ON | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_BUFFER | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_DOMAIN_INDEX_FILTER | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_PARTIAL_COMMIT | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_QKN_BUFF | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_REF_CASCADE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NUM_INDEX_KEYS | Undocumented but appears likely to specify the number of index keys if stats information is known to be misleading | |||||||||||||||||||
TBD | ||||||||||||||||||||
ORDERED_PREDICATES | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
OUTER_JOIN_TO_ANTI and NO_OUTER_JOIN_TO_ANTI |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
OVERFLOW_NOMOVE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
QUEUE_CURR | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
QUEUE_ROWP | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
REF_CASCADE_CURSOR | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
RESTORE_AS_INTERVALS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
ROWID | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SAVE_AS_INTERVALS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SKIP_EXT_OPTIMIZER | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SKIP_UNQ_UNUSABLE_IDX | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SQLLDR | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
STREAMS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SUBQUERY_PRUNING and NO_SUBQUERY_PRUNING |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SWAP_JOIN_INPUTS and NO_SWAP_JOIN_INPUTS |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SYS_DL_CURSOR | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SYS_PARALLEL_TXN | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
USE_ANTI | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
X_DYN_PRUNE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
General Purpos Hints | ||||||||||||||||||||
DRIVING_SITE Documented |
Forces query execution to be done at a user selected site rather than at a site selected by the database. This hint is useful if you are using distributed query optimization. | |||||||||||||||||||
/*+ DRIVING_SITE([@queryblock] <tablespec>) */ |
||||||||||||||||||||
SELECT p1.first_name, p2.first_name, p2.last_name |
||||||||||||||||||||
DYNAMIC_SAMPLING_EST_CDN | Undocumented: Forces cardinality estimation for analyzed tables. | |||||||||||||||||||
*/+ dynamic_sampling_est_cdn(<query_block>) */ |
||||||||||||||||||||
SELECT /*+ dynamic_sampling(e 1) dynamic_sampling_est_cdn(e) */ COUNT(*) |
||||||||||||||||||||
MONITOR Documented |
Forces real-time SQL monitoring for the query, even if the statement is not long running. This hint is valid only when the parameter CONTROL_MANAGEMENT_PACK_ACCESS is set to DIAGNOSTIC+TUNING. | |||||||||||||||||||
/*+ MONITOR */ |
||||||||||||||||||||
SELECT value |
||||||||||||||||||||
NO_MONITOR Documented |
Disables real-time SQL monitoring for the query, even if the query is long running. | |||||||||||||||||||
/*+ NO_MONITOR */ |
||||||||||||||||||||
-- this SQL statement is made intentionally long running |
||||||||||||||||||||
NO_PX_JOIN_FILTER Documented |
Prevents the optimizer from using parallel join bitmap filtering. | |||||||||||||||||||
/*+ NO_PX_JOIN_FILTER(<tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_RESULT_CACHE Documented |
The optimizer caches query results in the result cache if the RESULT_CACHE_MODE initialization parameter is set to FORCE. In this case, the NO_RESULT_CACHE hint disables such caching for the current query. | |||||||||||||||||||
/*+ NO_RESULT_CACHE */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
PX_JOIN_FILTER Documented |
Forces the optimizer to use parallel join bitmap filtering. | |||||||||||||||||||
/*+ PX_JOIN_FILTER(<tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
QB_NAME Documented |
Use the QB_NAME hint to define a name for a query block. This name can then be used in a hint in the outer query or even in a hint in an inline view to affect query execution on the tables appearing in the named query block. If two or more query blocks have the same name, or if the same query block is hinted twice with different names, then the optimizer ignores all the names and the hints referencing that query block. Query blocks that are not named using this hint have unique system-generated names. These names can be displayed in the plan table and can also be used in hints within the query block, or in query block hints. |
|||||||||||||||||||
/*+ QB_NAME(<query_block_name>) */ |
||||||||||||||||||||
conn hr/hr@pdbdev Here is Jonathan's response: You have two hints that are directed explicitly to a query block called subq_mmt - but after transformation that query block doesn't exist (so the hints are effectively meaningless), the query block SEL$798CEC2A has appeared instead from the unnesting and merging. The resulting query block is derived from the names of the query blocks that generated it, and is deterministic, so it's safe to use it in your own hints. So in your leading(), use_hash, and index_rs_asc hint you need to include @SEL$798CEC2A and then you should get the result you want. |
||||||||||||||||||||
RESULT_CACHE Documented |
Instructs the database to cache the results of the current query or query fragment in memory and then to use the cached results in future executions of the query or query fragment. The hint is recognized in the top-level query, the subquery_factoring_clause, or FROM clause inline view. The cached results reside in the result cache memory portion of the shared pool. | |||||||||||||||||||
/*+ RESULT_CACHE */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
In Memory Hints | ||||||||||||||||||||
Each of the following hints relates to the In-Memory Option | ||||||||||||||||||||
INMEMORY Documented |
Enables in-memory queries | |||||||||||||||||||
/*+ INMEMORY( [@QUERYBLOCK)] <tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
INMEMORY_PRUNING Documented |
Enables pruning of in-memory queries | |||||||||||||||||||
/*+ INMEMORY_PRUNING( [@QUERYBLOCK)] <tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_INMEMORY Documented |
Disables in-memory queries | |||||||||||||||||||
/*+ NO_INMEMORY( [@QUERYBLOCK)] <tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_INMEMORY_PRUNING Documented |
Disables pruning of in-memory queries | |||||||||||||||||||
/*+ NO_INMEMORY_PRUNING( [@QUERYBLOCK)] <tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
Join Operations Hints | ||||||||||||||||||||
Each hint described in this section suggests a table join operation. Join methods: In the loop join algorithm, an outer loop is formed that is composed of a few entries that are to be selected. Then, for each entry in the outer loop, a look-up is performed for matching entries, in the inner loop. In the merge join algorithm, both tables are accessed in the same order. If there's a sorted index on the matching column, on both tables, then no sorting is needed. All we have to do is read the rows in the order presented by the index. The reason it's called a merge join is that the algorithm, in detail, looks much like the algorithm for merging two (sorted) data streams together. Let's say we got two tables, ORDERS and ORDER_ITEMS. Let's say we have sorted indexes on ORDER_NUMBER on both tables. Naturally, the index on ORDERS can forbid duplicates, while the index on ORDER_ITEMS has to permit duplicates. Now, in this case, which algorithm is faster? It depends. Let's say we want to look up a single order. This happens in OLTP systems a lot. The loop join is probably faster. The outer loop will find a single order number, and that means the inner loop will have to probe the index on ORDER_ITEMS just once. This is true even if we have to scan the order table, based on CUSTOMER_ID and ORDER_DATE. Now let's say we want a report for all the reports, with details for April. The merge join is probably faster. With hundreds of orders to process, walking the index on ORDER_ITEMS once beats the heck out of doing hundreds of probes. |
||||||||||||||||||||
CUBE_AJ | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
FACTORIZE_JOIN and NO_FACTORIZE_JOIN |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
HASH_AJ | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
MERGE_AJ | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NATIVE_FULL_OUTER_JOIN Documented |
Instructs the optimizer to use native full outer join, which is a native execution method based on a hash join. I can't imagine why anyone would think this a good idea but here it is. | |||||||||||||||||||
/*+ NATIVE_FULL_OUTER_JOIN */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NL_AJ | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_NATIVE_FULL_OUTER_JOIN Documented |
Instructs the optimizer to exclude the native execution method when joining each specified table. Instead, the full outer join is executed as a union of left outer join and anti-join. | |||||||||||||||||||
/*+ NO_NATIVE_FULL_OUTER_JOIN */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_USE_BAND Documented |
Instructs the optimizer to exclude band joins when joining each specified table to another row source. | |||||||||||||||||||
/*+ NO_USE_BAND ([@queryblock)] <tablespec>) */ |
||||||||||||||||||||
SELECT /*+
NO_USE_BAND(e1 e2) */ e1.last_name || ' has salary between 100 less and 100 more than ' || e2.last_name AS "SALARY COMPARISON" |
||||||||||||||||||||
NO_USE_CUBE Documented |
Instructs the optimizer to exclude cube joins when joining each specified table to another row source using the specified table as the inner table. | |||||||||||||||||||
/*+ NO_USE_CUBE ([@queryblock)] <tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_USE_HASH Documented |
Instructs the optimizer to exclude hash joins when joining each specified table to another row source using the specified table as the inner table. | |||||||||||||||||||
/*+ NO_USE_HASH([@queryblock] <tablespec> <tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_USE_MERGE Documented |
Instructs the optimizer to exclude sort-merge joins when joining each specified table to another row source using the specified table as the inner table. | |||||||||||||||||||
/*+ NO_USE_MERGE([@queryblock] <tablespec> <tablespec>) */ |
||||||||||||||||||||
conn hr/hr@pdbdev |
||||||||||||||||||||
NO_USE_NL Documented |
Instructs the optimizer to exclude nested loops joins when joining each specified table to another row source using the specified table as the inner table. | |||||||||||||||||||
/*+ NO_USE_NL([@queryblock] <tablespec> <tablespec>) */ |
||||||||||||||||||||
conn oe/oe@pdbdev |
||||||||||||||||||||
OUTER_JOIN_TO_INNER and NO_OUTER_JOIN_TO_INNER |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PARTIAL_JOIN and NO_PARTIAL_JOIN |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PUSH_JOIN_PRED Undocumented |
Force pushing of a join predicate into the view (found in the 8.1.5 docs) | |||||||||||||||||||
/*+ PUSH_JOIN_PRED (<tablespec>) */ |
||||||||||||||||||||
SELECT /*+ PUSH_JOIN_PRED(v) */ T1.X, V.Y |
||||||||||||||||||||
USE_BAND Documented |
Instructs the optimizer to join each specified table with another row source using a band join. | |||||||||||||||||||
/*+ USE_BAND ([@queryblock)] <tablespec>) */ |
||||||||||||||||||||
SELECT /*+ USE_BAND(e1 e2) */ e1.last_name || ' has salary between 100 less and 100 more than ' || e2.last_name AS "SALARY COMPARISON" |
||||||||||||||||||||
USE_CUBE Documented |
When the right-hand side of the join is a cube, the USE_CUBE hint instructs the optimizer to join each specified table with another row source using a cube join. If the optimizer decides not to use the cube join based on statistical analysis, then you can use USE_CUBE to override that decision |
|||||||||||||||||||
/*+ USE_CUBE ([@queryblock)] <tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
USE_HASH Documented |
Causes Oracle to join each specified table with another row source using a hash join. | |||||||||||||||||||
/*+ USE_HASH([@queryblock] <tablespec> <tablespec>) */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
USE_MERGE Documented |
Causes Oracle to join each specified table with another row source with a sort-merge join. | |||||||||||||||||||
/*+ USE_MERGE([@queryblock] <tablespec> <tablespec>) */ |
||||||||||||||||||||
See USE_HASH Demo Above | ||||||||||||||||||||
USE_MERGE_CARTESIAN | Undocumented: Causes Oracle to join each specified table with another row source using a merge Cartesian join. | |||||||||||||||||||
TBD | ||||||||||||||||||||
USE_NL Documented |
Causes Oracle to join each specified table to another row source with a nested loops join using the specified table as the inner table. It stops the optimizer from evaluating the cost of a merge join or hash join - at a specific set of branch points in the CBO. | |||||||||||||||||||
/*+ USE_NL([@queryblock] <tablespec> <tablespec>) */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
USE_NL_WITH_INDEX Documented |
Instructs the optimizer to join the specified table to another row source with a nested loops join using the specified table as the inner table. | |||||||||||||||||||
/*+ USE_NL_WITH_INDEX([@queryblock] <tablespec> <index_name>) */ |
||||||||||||||||||||
conn oe/oe@pdbdev |
||||||||||||||||||||
Join Order Hints | ||||||||||||||||||||
The hints in this section suggest join orders: | ||||||||||||||||||||
LEADING Documented |
Instructs the optimizer to use the specified set of tables as the prefix in the execution plan. | |||||||||||||||||||
/*+ LEADING([@queryblock] <table_name> <table_name>) */ |
||||||||||||||||||||
conn hr/hr@pdbdev |
||||||||||||||||||||
ORDERED Documented |
Causes Oracle to only join tables in the order in which they appear in the FROM clause. | |||||||||||||||||||
/*+ ORDERED */ |
||||||||||||||||||||
conn oe/oe@pdbdev |
||||||||||||||||||||
Miscellaneous Hints | ||||||||||||||||||||
ANSI_REARCH and NO_ANSI_REARCH |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
AUTO_REOPTIMIZE and NO_AUTO_REOPTIMIZE |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
BYPASS_RECURSIVE_CHECK | See metalink for bug #1816154 | |||||||||||||||||||
TBD | ||||||||||||||||||||
BATCH_TABLE_ACCESS_BY_ROWID and NO_BATCH_TABLE_ACCESS_BY_ROWID |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
BITMAP_AND | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
BUSHY_JOIN and NO_BUSHY_JOIN |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
COALESCE_SQ and NO_COALESCE_SQ |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
COLLECTIONS_GET_REFS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
CPU_COSTING and NO_CPU_COSTING |
Disables/Enables Explain Plan cpu costing - the default is enabled | |||||||||||||||||||
EXPLAIN PLAN FOR |
||||||||||||||||||||
CURRENT_INSTANCE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
DATA_SECURITY_REWRITE_LIMIT and NO_DATA_SECURITY_REWRITE_LIMIT |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
DATA_VALIDATE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
DB_VERSION First Available:11.1.0.6 |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
DECORRELATE and NO_DECORRELATE |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
DEREF_NO_REWRITE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
DST_UPGRADE_INSERT_CONV and NO_DST_UPGRADE_INSERT_CONV |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
ELIMINATE_JOIN | Undocumented: First Available 10.2.0.1 | |||||||||||||||||||
See NO_ELIMINATE_JOIN below | ||||||||||||||||||||
ELIMINATE_OBY | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
ELIM_GROUPBY and NO_ELIM_GROUPBY |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
EXPAND_TABLE and NO EXPAND_TABLE |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
FORCE_SAMPLE_BLOCK | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
FRESH_MV Documented |
When querying a real-time materialized view this hint instructs the optimizer to use on-query computation to fetch up-to-date data from the materialized view, even if the materialized view is stale. The optimizer ignores this hint in SELECT statement blocks that query an object that is not a real-time materialized view, and in all UPDATE, INSERT, MERGE, and DELETE statement blocks. |
|||||||||||||||||||
/*+ FRESH_MV */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
GBY_PUSHDOWN | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
GROUPING Documented |
Use with data mining scoring functions when scoring partitioned models. This hint results in partitioning the input data set into distinct data slices so that each partition is scored in its entirety before advancing to the next partition. Parallelism by partition is still available. Data slices are determined by the partitioning key columns that were used when the model was built. This method can be used with any data mining function against a partitioned model. The hint may yield a query performance gain when scoring large data that is associated with many partitions, but may negatively impact performance when scoring large data with few partitions on large systems. Typically, there is no performance gain if you use this hint for single row queries. | |||||||||||||||||||
/*+ GROUPING */ |
||||||||||||||||||||
SELECT PREDICTION(/*+ GROUPING */my_model USING *) pred |
||||||||||||||||||||
IGNORE_ON_CLAUSE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
IGNORE_OPTIM_EMBEDDED_HINTS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
IGNORE_WHERE_CLAUSE Undocumented |
The following does not work so this hint is not as obvious as it might, at first, seem. | |||||||||||||||||||
/*+ IGNORE_WHERE_CLAUSE */ |
||||||||||||||||||||
SELECT /*+ IGNORE_WHERE_CLAUSE */ COUNT(*) |
||||||||||||||||||||
INCLUDE_VERSION | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
JSON_LENGTH (new 19c) ![]() |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
MEMOPTIMIZE_WRITE | Undocumented: Relates to the Memoptimize Pool introduced in version 18c. | |||||||||||||||||||
TBD | ||||||||||||||||||||
NESTED_TABLE_FAST_INSERT | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NESTED_TABLE_GET_REFS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NESTED_TABLE_SET_SETID | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NESTED_TABLE_SET_REFS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_ACCESS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_BIND_AWARE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_CARTESIAN | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_CONNECT_BY_COMBINE_SW | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_CONNECT_BY_FILTERING | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_ELIMINATE_JOIN Undocumented |
First Available 10.2.0.1 | |||||||||||||||||||
/*+ NO_ELIMINATE_JOIN(<table_alias>) */ |
||||||||||||||||||||
SELECT /*+ gather_plan_statistics optimizer_features_enable('10.2.0.4') */ * |
||||||||||||||||||||
NO_FILTERING | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_LOAD | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_MONITORING Undocumented |
Likely a legacy version of NO_MONITOR from version 8.0. | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_PUSH_JOIN_PRED Undocumented |
Prevents pushing of a join predicate into a view. | |||||||||||||||||||
/*+ NO_PUSH_JOIN_PRED (<tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_SQL_TUNE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_SUBSTRB_PAD | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_USE_INVISIBLE_INDEXES | Instructs the optimizer not to use invisible indexes even if they are available in the session | |||||||||||||||||||
/*+ NO_USE_INVISIBLE_INDEXES */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
NO_ZONEMAP Documented |
Disables the use of a zone map for different types of pruning. This hint overrides an ENABLE PRUNING setting in the DDL that created or altered the zone map. v$sql_hint shows an officially undocumented inverse hint named ZONEMAP hint which we have included below. |
|||||||||||||||||||
/*+ NO_ZONEMAP ( [@queryblock] <tablespec> <JOIN | PARTITION | SCAN>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
OUTLINE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
OUTLINE_LEAF | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PARTIAL_ROLLUP_PUSHDOWN and NO_PARTIAL_ROLLUP_PUSHDOWN |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PIV_GB | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PIV_SSF | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PLACE_DISTINCT and NO_PLACE_DISTINCT |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PLACE_GROUP_BY and NO_PLACE_GROUP_BY |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PRECOMPUTE_SUBQUERY | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PRESERVE_OID | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PUSH_HAVING_TO_GBY and NO_PUSH_HAVING_TO_GBY |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
QUARANTINE (new 19c) ![]() |
Enables SQL Quarantine operations: See the DBMS_SQLQ built-in package. Only available on Exadata with Enterprise Edition. Use DBMS_SQLDIAG.CREATE_SQL_PATCH to insert this hint into application compiled SQL. |
|||||||||||||||||||
TBD | ||||||||||||||||||||
RBO_OUTLINE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
REMOTE_MAPPED | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
RESERVOIR_SAMPLING | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
RESTRICT_ALL_REF_CONS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SCN_ASCENDING | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SET_TO_JOIN and NO_SET_TO_JOIN |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SKIP_PROXY | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SQL_SCOPE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SUPPRESS_LOAD | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SYS_RID_ORDER | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
TABLE_LOOKUP_BY_NL and NO_TABLE_LOOKUP_BY_NL |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
TIV_GB | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
TIV_SSF | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
TRACING | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
USE_DAGG_UNION_ALL_GSETS and NO_USE_DAGG_UNION_ALL_GSETS |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
USE_HASH_AGGREGATION and NO_USE_HASH_AGGREGATION |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
USE_HASH_GBY_FOR_DAGGPSHD and NO_USE_HASH_GBY_FOR_DAGGPSHD |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
USE_HASH_GBY_FOR_PUSHDOWN and NO_USE_HASH_GBY_FOR_PUSHDOWN |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
USE_INVISIBLE_INDEXES Documented but not in the Hints documentation |
Instructs the optimizer to consider the user of invisible indexes. | |||||||||||||||||||
/*+ USE_INVISIBLE_INDEXES */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
USE_WEAK_NAME_RESL | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
WITH_PLSQL | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
XDB_FASTPATH_INSERT and NO_XDB_FASTPATH_INSERT | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
ZONEMAP Undocumented |
Introduced in version 12.1.0.1 with NO_ZONEMAP which is documented | |||||||||||||||||||
/*+ ZONEMAP ( [@queryblock] <tablespec> <JOIN | PARTITION | SCAN>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
Model Claus Hints | ||||||||||||||||||||
MODEL_COMPILE_SUBQUERY | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
MODEL_DONTVERIFY_UNIQUENESS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
MODEL_DYNAMIC_SUBQUERY | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
MODEL_MIN_ANALYSIS Documented |
Instructs the optimizer to omit some compile-time optimizations of spreadsheet rules—primarily detailed dependency graph analysis.
Other spreadsheet optimizations, such as creating filters to selectively populate spreadsheet access structures and limited rule pruning, are still used by the optimizer. This hint reduces compilation time because spreadsheet analysis can be lengthy if the number of spreadsheet rules is more than several hundreds. |
|||||||||||||||||||
/*+ MODEL_MIN_ANALYSIS */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
MODEL_NO_ANALYSIS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
MODEL_PUSH_REF | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_MODEL_PUSH_REF | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
Optimization Approaches and Goals Hints | ||||||||||||||||||||
Mode hints were introduced in version 8.1.0 and none have related inverse hints. | ||||||||||||||||||||
ALL_ROWS Documented |
The ALL_ROWS hint explicitly chooses the cost-based approach to optimize a statement block with a goal of best throughput (that is, minimum total resource consumption). | |||||||||||||||||||
/*+ ALL_ROWS */ |
||||||||||||||||||||
conn / as sysdba |
||||||||||||||||||||
CHOOSE | /*+ CHOOSE */ |
|||||||||||||||||||
TBD | ||||||||||||||||||||
FIRST_ROWS(n) Documented As of 12c Adaptive Execution Plans are disabled by this hint |
The FIRST_ROWS hint explicitly chooses the cost-based approach to optimize a statement block with a goal of best response time (minimum resource usage to return first row). This hint causes the optimizer to make these choices:
|
|||||||||||||||||||
/*+ FIRST_ROWS(<integer>) */ |
||||||||||||||||||||
set autotrace trace exp |
||||||||||||||||||||
RULE Undocumented Deprecated |
Disables the Cost Based optimizer. This hint is not supported and should not be used. We are not sure if it is still active but include it here for backward compatibility. | |||||||||||||||||||
/*+ RULE */ |
||||||||||||||||||||
set autotrace trace exp |
||||||||||||||||||||
Optimizer Feature Enabling Hints | ||||||||||||||||||||
CARDINALITY Undocumented Deprecated |
Instructs the optimizer to use the provided integer as the computed cardinality of the table, or pipelined table function, without checking. | |||||||||||||||||||
/*+ CARDINALITY(<tablespec>, <integer>) */ |
||||||||||||||||||||
Superceded by the OPT_ESTIMATE hint | ||||||||||||||||||||
CURSOR_SHARING_EXACT Documented |
Oracle can replace literals in SQL statements with bind variables, when it is safe to do so. This replacement is controlled with the CURSOR_SHARING initialization parameter. The CURSOR_SHARING_EXACT hint instructs the optimizer to switch this behavior off. In other words, Oracle executes the SQL statement without any attempt to replace literals with bind variables. | |||||||||||||||||||
/*+ CURSOR_SHARING_EXACT */ |
||||||||||||||||||||
conn / as sysdba |
||||||||||||||||||||
DYNAMIC_SAMPLING Documented |
The DYNAMIC_SAMPLING hint instructs the optimizer how to control dynamic sampling to improve server performance by determining more accurate predicate selectivity and statistics for tables and indexes. You can set the value of DYNAMIC_SAMPLING to a value from 0 to 10. The higher the level, the more effort the compiler puts into dynamic sampling and the more broadly it is applied. Sampling defaults to cursor level unless you specify tablespec. The integer value is 0 to 10, indicating the degree of sampling. For pipelined table functions the range of values is 2 to 10. Force dynamic sampling of tables where statistics do not exist such as Global Temporary Tables. If the table is aliased the alias name, not the table name must be used. |
|||||||||||||||||||
/*+ DYNAMIC_SAMPLING([@queryblock] [<tablespec>] <integer>) */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
OPTIMIZER_FEATURES_ENABLE Documented |
Acts as an umbrella parameter for enabling a series of optimizer features based on an Oracle Database release number. It can be used tocheck for plan regressions after database upgrades. Specify the release number as an argument to the hint. | |||||||||||||||||||
/*+ optimizer_features_enable('<version_number>') */ |
||||||||||||||||||||
SELECT /*+ OPTIMIZER_FEATURE_ENABLE('11.1.0.7') */ latitude, longitude |
||||||||||||||||||||
OPT_ESTIMATE Undocumented Supercedes the CARDINALITY hint |
Adjusts the CBO's default scaling factor. | |||||||||||||||||||
/*+ OPT_ESTIMATE(table, <alias>, scale_rows=<scaling_factor>) */ |
||||||||||||||||||||
conn hr/hr@pdbdev |
||||||||||||||||||||
OPT_PARAM Documented |
Lets you set an initialization parameter for the duration of the current query only. This hint is valid only for the following parameters: OPTIMIZER_DYNAMIC_SAMPLING, OPTIMIZER_INDEX_CACHING, OPTIMIZER_INDEX_COST_ADJ, OPTIMIZER_SECURE_VIEW_MERGING, and STAR_TRANSFORMATION_ENABLED. For example, the following hint sets the parameter STAR_TRANSFORMATION_ENABLED to TRUE for the statement to which it is added. | |||||||||||||||||||
/*+ OPT_PARAM(parameter_name, parameter_value) */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
Parallel Hints | ||||||||||||||||||||
The NOPARALLEL and SHARED were introduced in 8.1.0. NO_PARALLEL was introduced in 10.1.0.3 as a replacement for NOPARALLEL to confirm with the hint naming convention. The hints described in this section determine how statements are parallelized or not parallelized when using parallel execution. | ||||||||||||||||||||
CIV_GB Documented |
Internal hint related to parallel query | |||||||||||||||||||
/*+ CIV_GB */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
DISABLE_PARALLEL_DML Documented |
Disables parallel DML for DELETE, INSERT, MERGE, and UPDATE statements. Can be used to disable parallel DML for an individual statement when parallel DML is enabled for the session with the ALTER SESSION ENABLE PARALLEL DML statement. |
|||||||||||||||||||
/*+ DISABLE_PARALLEL_DML */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
DIST_AGG_PROLLUP_PUSHDOWN | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
ENABLE_PARALLEL_DML Documented |
Enables parallel DML for DELETE, INSERT, MERGE, and UPDATE statements. You can use this hint to enable parallel DML for an individual statement, rather than enabling parallel DML for the session with the ALTER SESSION ENABLE PARALLEL DML statement. | |||||||||||||||||||
/*+ ENABLE_PARALLEL_DML */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_DIST_AGG_PROLLUP_PUSHDOWN | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_PARALLEL and NOPARALLEL Documented |
Overrides a PARALLEL specification in the table clause. In general, hints take precedence over table clauses. | |||||||||||||||||||
/*+ NO_PARALLEL([@queryblock] <tablespec>) */ |
||||||||||||||||||||
conn hr/hr@pdbdev |
||||||||||||||||||||
NO_PARALLEL_INDEX and NO_PARALLEL_INDEX Documented |
Override a PARALLEL attribute setting on an index. In this way you can avoid a parallel index scan operation. | |||||||||||||||||||
/*+ NO_PARALLEL_INDEX([@queryblock] <tablespec> <index_name>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_PQ_CONCURRENT_UNION Documented |
Instructs the optimizer to disable concurrent processing of UNION and UNION ALL operations. | |||||||||||||||||||
/*+ NO_PQ_CONCURRENT_UNION[(@queryblock)] */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_PQ_EXPAND_TABLE (new 19c) ![]() |
Undcoumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_PQ_REPLICATE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_PQ_SKEW Documented |
Advises the optimizer that the distribution of the values of the join keys for a parallel join is not skewed—that is, a high percentage of rows do not have the same join key values. The table specified in tablespec is the probe table of the hash join | |||||||||||||||||||
/*+ NO_PQ_SKEW( */[@queryblock] <tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_STATEMENT_QUEUING Documented |
Influences whether or not a statement is queued with parallel statement queuing. When PARALLEL_DEGREE_POLICY is set to AUTO, this hint enables a statement to bypass the parallel statement queue.
A statement that bypasses the statement queue can potentially cause the system to exceed the maximum number of parallel execution servers defined by the value of the PARALLEL_SERVERS_TARGET initialization parameter,
which determines the limit at which parallel statement queuing is initiated. There is no guarantee that the statement that bypasses the parallel statement queue receives the number of parallel execution servers requested because only the number of parallel execution servers available on the system, up to the value of the PARALLEL_MAX_SERVERS initialization parameter, can be allocated. |
|||||||||||||||||||
/*+ NO_STATEMENT_QUEUING */ |
||||||||||||||||||||
SELECT /*+ NO_STATEMENT_QUEUING */
s.server_name,
i.location_name |
||||||||||||||||||||
NO_USE_SCALABLE_GBY_INVDIST (new 19c) ![]() |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PARALLEL Documented |
Specifies the desired number of concurrent servers that can be used for a parallel operation. The hint applies to the INSERT, UPDATE, and DELETE portions of a statement as well as to the table scan portion. If any parallel restrictions are violated, the hint is ignored. The hint will (roughly speaking) make the optimizer divide a critical value by the value specified – at a specific set of points in the CBO. | |||||||||||||||||||
/*+ PARALLEL([@queryblock] <tablespec> <degree | DEFAULT>) */ |
||||||||||||||||||||
conn hr/hr@pdbdev |
||||||||||||||||||||
PARALLEL_INDEX Documented |
Specify the desired number of concurrent servers that can be used to parallelize index range scans for partitioned indexes. | |||||||||||||||||||
/*+ PARALLEL_INDEX([@queryblock] <tablespec> <index_name> <degree | DEFAULT>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
PQ_CONCURRENT_UNION Documented |
Instructs the optimizer to enable concurrent processing of UNION and UNION ALL operations. | |||||||||||||||||||
/*+ NO_PQ_CONCURRENT_UNION[(@queryblock)] */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
PQ_DISTRIBUTE Documented |
Improve parallel join operation performance. Do this by specifying how rows of joined tables should be distributed among producer and consumer query servers. Using this hint overrides decisions the optimizer would normally make. Outer_distribution is the distribution for the outer table. Inner_distribution is the distribution for the inner table. Distribution values are: NONE, PARTITION, RANDOM, RANDOM_LOCAL |
|||||||||||||||||||
/*+ PQ_DISTRIBUTE([@queryblock] <tablespec> <distribution>) */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
PQ_DISTRIBUTE_WINDOW | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PQ_EXPAND_TABLE (new 19c) ![]() |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PQ_FILTER Documented |
Instructs the optimizer on how to process rows when filtering correlated subqueries. | |||||||||||||||||||
/*+ PQ_FILTER(<HASH | NONE | RANDOM | SERIAL>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
PQ_MAP | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PQ_NOMAP | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PQ_REPLICATE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PQ_SKEW Documented |
Advises the optimizer that the distribution of the values of the join keys for a parallel join is highly skewed—that is, a high percentage of rows have the same join key values. The table specified in tablespec is the probe table of the hash join. | |||||||||||||||||||
/*+ PQ_SKEW([@queryblock] tablespec) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
PX_FAULT_TOLERANCE and NO_PX_FAULT_TOLERANCE |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SHARED | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
STATEMENT_QUEUING Documented |
Influences whether or not a statement is queued with parallel statement queuing. When PARALLEL_DEGREE_POLICY is not set to AUTO, this hint enables a statement to be considered for parallel statement queuing, but to run only when enough parallel processes are available to run at the requested DOP. The number of available parallel execution servers, before queuing is enabled, is equal to the difference between the number of parallel execution servers in use and the maximum number allowed in the system, which is defined by the PARALLEL_SERVERS_TARGET initialization parameter. | |||||||||||||||||||
/*+ STATEMENT_QUEUING */ |
||||||||||||||||||||
SELECT /*+ STATEMENT_QUEUING */ s.server_name, si.install_location |
||||||||||||||||||||
USE_SCALABLE_GBY_INVDIST (new 19c) ![]() |
xx | |||||||||||||||||||
TBD | ||||||||||||||||||||
Partitioning Hints | ||||||||||||||||||||
REORDER_WIF and NO_REORDER_WIF |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
USE_HIDDEN_PARTITIONS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_USE_PARTITION_WISE_DISTINCT | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_USE_PARTITION_WISE_GBY | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_USE_PARTITION_WISE_WIF | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
USE_PARTITION_WISE_DISTINCT | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
USE_PARTITION_WISE_GBY | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
USE_PARTITION_WISE_WIF | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
Query Rewrite Hints | ||||||||||||||||||||
The rewrite hints were introduced in two batches. REWRITE and NO_REWRITE in 8.1.5 and the remainder in 10.1.0.3. | ||||||||||||||||||||
CHECK_ACL_REWRITE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_BASETABLE_MULTIMV_REWRITE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_COST_XML_QUERY_REWRITE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_MULTIMV_REWRITE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_PULL_PRED | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_PUSH_PRED Documented |
Instructs the optimizer not to push a join predicate into the view. | |||||||||||||||||||
/*+ NO_PUSH_PRED(<@queryblock> | <[@queryblock> <tablespec>]) */ |
||||||||||||||||||||
conn hr/hr@pdbdev |
||||||||||||||||||||
NOREWRITE and NO_REWRITE Documented |
Use on any query block of a request. This hint disables query rewrite for the query block, overriding the setting of the parameter QUERY_REWRITE_ENABLED. | |||||||||||||||||||
/*+ NO_REWRITE(<@queryblock>) */ |
||||||||||||||||||||
conn sh/sh@pdbdev |
||||||||||||||||||||
OLD_PUSH_PRED | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
OR_EXPAND and NO_OR_EXPAND | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PULL_PRED | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PUSH_PRED Documented |
Instructs the optimizer to push a join predicate into the view. | |||||||||||||||||||
/*+ PUSH_PRED(<@queryblock> | <[@queryblock> <tablespec>]) */ |
||||||||||||||||||||
conn hr/hr@pdbdev |
||||||||||||||||||||
REWRITE Documented |
Use with or without a view list. If you use REWRITE with a view list and the list contains an eligible materialized view, Oracle uses that view regardless of its cost. Oracle does not consider views outside of the list. If you do not specify a view list, Oracle searches for an eligible materialized view and always uses it regardless of its cost. | |||||||||||||||||||
/*+ REWRITE([@queryblock] <view, view, ...>) */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
REWRITE_OR_ERROR | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
Query Transformation Hints | ||||||||||||||||||||
CONNECT_BY_CB_WHR_ONLY | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
CONNECT_BY_COST_BASED | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
CONNECT_BY_COMBINE_SW | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
CONNECT_BY_ELIM_DUPS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
CONNECT_BY_FILTERING | Undocumented but found in an AWR report as shown. | |||||||||||||||||||
SELECT /*+ connect_by_filtering */ privilege#, level |
||||||||||||||||||||
EXPAND_GSET_TO_UNION | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
FACT Documented |
In the context of the star transformation instructs the optimizer that the table specified be considered a fact table. | |||||||||||||||||||
/*+ FACT([@queryblock] <tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
GBY_CONC_ROLLUP | Undocumented: Likely related to GROUP BY and ROLLUP | |||||||||||||||||||
TBD | ||||||||||||||||||||
INLINE | Undocumented: If you want to control the optimiser, then the 'materialize' hint makes it create a temporary table; the 'inline' hint makes it perform 'macro-substitution'. ~ Jonathan Lewis |
|||||||||||||||||||
TBD | ||||||||||||||||||||
LIKE_EXPAND | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
MATERIALIZE | Undocumented: If you want to control the optimiser, then the 'materialize' hint makes it create a temporary table; the 'inline' hint makes it perform 'macro-substitution'. ~ Jonathan Lewis |
|||||||||||||||||||
TBD | ||||||||||||||||||||
MERGE Documented |
The MERGE hint lets you merge views in a query. If a view's query block contains a GROUP BY clause or DISTINCT operator in the SELECT list, then the optimizer can merge the view into the accessing statement only if complex view merging is enabled. Complex merging can also be used to merge an IN subquery into the accessing statement if the subquery is uncorrelated. | |||||||||||||||||||
/*+ MERGE(<@queryblock> [tablespec]); */ |
||||||||||||||||||||
conn hr/hr@pdbdev |
||||||||||||||||||||
MV_MERGE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_CHECK_ACL_REWRITE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_CONNECT_BY_CB_WHR_ONLY | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_CONNECT_BY_COST_BASED | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_CONNECT_BY_ELIM_DUPS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_EXPAND Documented |
Prevents the cost-based optimizer from considering OR-expansion for queries having OR conditions or INLISTS in the WHERE clause. Normally, the optimizer would consider using OR expansion and use this method if it decides the cost is lower than not using it. | |||||||||||||||||||
/*+ NO_EXPAND(<@queryblock>); |
||||||||||||||||||||
conn oe/oe@pdbdev |
||||||||||||||||||||
NO_EXPAND_GSET_TO_UNION | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_FACT Documented |
Used in the context of the star transformation. Instruct the optimizer that the queried table should not be considered as a fact table. | |||||||||||||||||||
/*+ NO_FACT([@queryblock] <tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_MERGE Documented |
Instructs the optimizer not to combine the outer query and any inline view queries into a single query. This hint makes the optimizer bypass some code that would otherwise transform a query using the rules of complex view merging. | |||||||||||||||||||
/*+ NO_MERGE(<@queryblock> [tablespecification]); */ |
||||||||||||||||||||
conn hr/hr@pdbdev |
||||||||||||||||||||
NO_ORDER_ROLLUPS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_PRUNE_GSETS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_PUSH_SUBQ Documented |
Instructs the optimizer to evaluate nonmerged subqueries as the last step in the execution plan. Doing so can improve performance if the subquery is relatively expensive or does not reduce the number of rows significantly. | |||||||||||||||||||
/*+ NO_PUSH_SUBQ(<@queryblock>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_QUERY_TRANSFORMATION Documented |
Instructs the optimizer to skip all query transformations, including but not limited to OR-expansion, view merging, subquery unnesting, star transformation, and materialized view rewrite. | |||||||||||||||||||
/*+ NO_QUERY_TRANSFORMATION) */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
NO_STAR_TRANSFORMATION Documented |
Instructs the optimizer not to perform star query transformation. | |||||||||||||||||||
/*+ NO_STAR_TRANSFORMATION(<@queryblock>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NO_UNNEST Documented |
Turns off subqueries unnesting for the current statement. | |||||||||||||||||||
/*+ NO_UNNEST(<@queryblock>) */ |
||||||||||||||||||||
conn uwclass/uwclass@pdbdev |
||||||||||||||||||||
OPAQUE_TRANSFORM | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
OPAQUE_XCANONICAL | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
PRECOMPUTE_SUBQUERY | Undocumented: Tanel Poder's blog entry on this hint is the best on the web so here's the link. Below I have just copied from Tanel an example of the proper usage of this hint from his blog. [Click Here] | |||||||||||||||||||
SELECT a |
||||||||||||||||||||
PUSH_SUBQ Documented. |
Instructs the optimizer to evaluate nonmerged subqueries at the earliest possible step in the execution plan. Generally, subqueries that are not merged are executed as the last step in the execution plan.
If the subquery is relatively inexpensive and reduces the number of rows significantly, then evaluating the subquery earlier can improve performance. This hint has no effect if the subquery is applied to a remote table or one that is joined using a merge join. |
|||||||||||||||||||
/*+ PUSH_SUBQ(<@queryblock>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
STAR_TRANSFORMATION Documented STAR, from version 8.1 is deprecated. |
Instructs the optimizer to use the best plan in which the transformation has been used. Without the hint, the optimizer could make a query optimization decision to use the best plan generated without the transformation,
instead of the best plan for the transformed query. When specified, there is no guarantee that the transformation will take place. The optimizer generates the subqueries only if it seems reasonable to do so. If no subqueries are generated, then there is no transformation and the best plan for the untransformed query is used, ignoring the hint. |
|||||||||||||||||||
/*+ STAR_TRANSFORMATION[(<@queryblock>)] */ |
||||||||||||||||||||
conn sh/sh@pdbdev |
||||||||||||||||||||
TRANSFORM_DISTINCT_AGG and NO_TRANSFORM_DISTINCT_AGG |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
UNNEST Documented |
Instructs the optimizer to unnest and merge the body of the subquery into the body of the query block that contains it, allowing the optimizer to consider them together when evaluating access paths and joins. | |||||||||||||||||||
/*+ UNNEST(<@queryblock>) */ |
||||||||||||||||||||
See NO_UNNEST Demo Above | ||||||||||||||||||||
USE_CONCAT Documented |
Forces combined OR conditions in the WHERE clause of a query to be transformed into a compound query using the UNION ALL set operator.
Normally, this transformation occurs only if the cost of the query using the concatenations is cheaper than the cost without them. The USE_CONCAT hint turns off inlist processing and OR-expands all disjunctions, including inlists. |
|||||||||||||||||||
/*+ USE_CONCAT */ |
||||||||||||||||||||
conn hr/hr@pdbdev |
||||||||||||||||||||
USE_TTT_FOR_GSETS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
Semantic-Effect Hints also known as Online Application Upgrade Hints | ||||||||||||||||||||
CHANGE_DUPKEY_ERROR_INDEX Documented |
This hint provides a mechanism to unambiguously identify a unique key violation for a specified set of columns or for a specified index. When a unique key violation occurs for the specified index, an ORA-38911 error is reported instead of an ORA-00001. | |||||||||||||||||||
CHANGE_DUPKEY_ERROR_INDEX(<table_name>,<index_name>); |
||||||||||||||||||||
CREATE TABLE t ( |
||||||||||||||||||||
IGNORE_ROW_ON_DUPKEY_INDEX Documented |
This hint applies only to single-table INSERT operations. It causes the statement to ignore a unique key violation for a specified set of columns or for a specified index. When a unique key violation is encountered, a row-level rollback occurs and execution resumes with the next input row. If you specify this hint when inserting data with DML error logging enabled, then the unique key violation is not logged and does not cause statement termination. | |||||||||||||||||||
IGNORE_ROW_ON_DUPKEY_INDEX(table, index); |
||||||||||||||||||||
CREATE TABLE t ( |
||||||||||||||||||||
RETRY_ON_ROW_CHANGE Documented This demo is a modified version of Rob van Wijk. I wrote my own demo, not much different from Rob's. But the truth is that Rob's is better so I have made a few small changes but essentially what you see to the right is what Rob wrote. I often produce copies of valuable examples when I have concerns that they might some day not still be available. |
This hint is valid only for UPDATE and DELETE operations. It is not supported for INSERT or MERGE. When specified the operation is retried when the ORA_ROWSCN for one or more rows in the set has changed from the time the set of rows to be modified is determined to the time the block is actually modified. | |||||||||||||||||||
-- demo setup |
||||||||||||||||||||
|
||||||||||||||||||||
Semijoin Hints | ||||||||||||||||||||
The first semijoin hint, NL_SJ, was introduced in 8.0.0, HASH_SJ and MERGE_SJ in 8.1.0, and NO_SEMI_JOIN and SEMIJOIN in 9.0.0. | ||||||||||||||||||||
CUBE_SJ | Cube Semi-Join | |||||||||||||||||||
TBD | ||||||||||||||||||||
HASH_SJ | Hash Semi-Join | |||||||||||||||||||
TBD | ||||||||||||||||||||
MERGE_SJ | Transforms a correlated EXISTS subquery into a merge semi-join to access the specified table. | |||||||||||||||||||
/*+ MERGE_SJ (<tablespec>) */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
NL_SJ | Nested Loop Semi-Join | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_SEMIJOIN | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_SEMI_TO_INNER | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SEMIJOIN | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SEMIJOIN_DRIVER | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
SEMI_TO_INNER | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
USE_SEMI | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
Stats Hints | ||||||||||||||||||||
All three of these hints were introduced in 10.1.0.3. | ||||||||||||||||||||
ANSWER_QUERY_USING_STATS and NO_ANSWER_QUERY_USING_STATS |
Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
COLUMN_STATS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
DBMS_STATS | Undocumented: According to comments from Jonathan Lewis this not an Oracle hint but rather explanatory text put in by some developers to label code and make it easier to identify the statement as being generated by DBMS_STATS. | |||||||||||||||||||
/*+ DBMS_STATS */ |
||||||||||||||||||||
TBD | ||||||||||||||||||||
GATHER_OPTIMIZER_STATISTICS Documented |
Instructs the optimizer to enable statistics gathering during the following types of bulk load
|
|||||||||||||||||||
/*+ GATHER_OPTIMIZER_STATISTICS */ |
||||||||||||||||||||
SELECT */+ gather_optimizer_statistics */ * |
||||||||||||||||||||
GATHER_PLAN_STATISTICS | Must be the first hint if more than one hint is present. - STATS? | |||||||||||||||||||
TBD | ||||||||||||||||||||
INDEX_STATS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_GATHER_OPTIMIZER_STATISTICS Documented |
Instructs the optimizer to enable statistics gathering during the following types of bulk load
|
|||||||||||||||||||
/*+ NO_GATHER_OPTIMIZER_STATISTICS */ |
||||||||||||||||||||
SELECT /*+ NO_GATHER_OPTIMIZER_STATISTICS */ * |
||||||||||||||||||||
NO_STATS_GSETS | Undocumented - STATS? | |||||||||||||||||||
TBD | ||||||||||||||||||||
SYSTEM_STATS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
TABLE_STATS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
Vector Hints | ||||||||||||||||||||
NO_USE_VECTOR | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_VECTOR_TRANSFORM | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_VECTOR_TRANSFORM_DIMS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_VECTOR_TRANSFORM_FACT | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
USE_VECTOR_AGGREGATION | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
VECTOR_READ | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
VECTOR_READ_TRACE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
VECTOR_TRANSFORM | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
VECTOR_TRANSFORM_DIMS | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
VECTOR_TRANSFORM_FACT | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
XML and XMLINDEX_REWRITE Hints | ||||||||||||||||||||
COST_XML_QUERY_REWRITE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
FORCE_XML_QUERY_REWRITE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
INLINE_XMLTYPE_NT | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_COST_XML_QUERY_REWRITE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_XML_DML_REWRITE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
NO_XML_QUERY_REWRITE Documented |
Instructs the optimizer to prohibit the rewriting of XPath expressions in SQL statements. | |||||||||||||||||||
/*+ NO_XML_QUERY_REWRITE */ |
||||||||||||||||||||
SELECT /*+NO_XML_QUERY_REWRITE*/ XMLQUERY('<A/>') |
||||||||||||||||||||
NO_XMLINDEX_REWRITE Documented |
Instructs the optimizer to prohibit the rewriting of XPath expressions in SQL statements. | |||||||||||||||||||
/*+ NO_XMLINDEX_REWRITE */ |
||||||||||||||||||||
SELECT /*+ NO_XMLINDEX_REWRITE */ COUNT(*) |
||||||||||||||||||||
NO_XMLINDEX_REWRITE_IN_SELECT | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
XML_DML_RWT_STMT | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
XMLINDEX_REWRITE | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
XMLINDEX_REWRITE_IN_SELECT | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
XMLINDEX_SEL_IDX_TBL | Undocumented | |||||||||||||||||||
TBD | ||||||||||||||||||||
XMLTSET_DML_ENABLE | Undocumented | |||||||||||||||||||
TBD |
Related Topics |
Histograms |
Index Scans |
Outlines |
SELECT Statements |
Tuning |
What's New In 21c |
What's New In 23c |
This site is maintained by Dan Morgan. Last Updated: | This site is protected by copyright and trademark laws under U.S. and International law. © 1998-2023 Daniel A. Morgan All Rights Reserved | |||||||||
|
||||||||||