Professional Documents
Culture Documents
Using Hints
Hints can be used in the Select, Delete, and Update clauses. In each statement, the hint goes directly after the Select, Delete, or Update keyword. A few hints use Insert. Hints are placed in the /*+ */ tag, where the hint goes after the + sign Ex: SELECT /*+ ALL_ROWS */ From
Types of Hints
Approach hints Access hints Join hints Misc. hints
Approach Hints
ALL_ROWS: Minimizes total resource consumption. Results will be returned only after all processing has been completed FIRST_ROWS(n): Minimized response time, or minimal resource usage to return the first n rows.
Access Hints
FULL(table): Chooses a full table scan for the table, even if there is an index available. INDEX(table [index [index]...]): Chooses an Index scan for the table.
Join hints
ORDERED: tables are joined in the order in which they appear in the FROM clause. LEADING(table): specified table is the first table used in the join order. USE_HASH(table [table] ): Tables are joined using a hash join. Smaller table is used to make a hash table on join key. The larger table is scanned using hash table to find joined rows.
Misc. Hints
APPEND: Data is appended to the end of table, rather then using existing space. CACHE(table): Blocks received are placed at the most recently used end of the LRU list in the buffer cache when a full table scan is preformed. NOCACHE(table): Blocks received are placed at the least recently used end of the LRU list in the buffer cache.
Sources
Oracle documentation at: http://oracle.cis.ksu.edu/oradocs/index.htm