学习oracle技术,每天学一点,每天进步一点
oracle sql tunning all hints
The following is a list of all hints available in Oracle9i. Many of the hints are also available in earlier releases of Oracle. The purpose of this list is not to exhaustively describe the syntax of each hint, but to show the way each hint is most commonly used.ITPUB个人空间!SD
l9w7H.r
ALL_ROWSITPUB个人空间TV Mak [s
Optimizes for least resource usageto return all rows required by the query. This hint will sometimes override a NESTED LOOP with a SORT MERGE or a HASH JOIN if applied to a SELECT, UPDATE, or DELETE statement when OPTIMIZER_MODE=CHOOSE.
3s ^h;D3];[0SELECT /*+ ALL_ROWS */ ...
GVJ*GN%g0ITPUB个人空间,nTX)h Nbx
AND_EQUAL (table index1 index2[... index5])
pmI|vX)I0Explicitly merges single-column indexes. A minimum of two indexes must be specified, and no more than five are allowed. Single-column index merges can be incredibly inefficient if the first index in the WHERE returns a lot of rows.
OuN:aM0SELECT /*+ AND_EQUAL(horse_owners ho_ndx1
^ Ny;z2W}m0ho_ndx2 ho_ndx3) */ITPUB个人空间l6C Tyt*? Kf8tQ
count(*)ITPUB个人空间0b!r| BtMY8u
FROM horse_owners
6Q0vO.mZ0WHERE horse_name = 'WILD CHARM'
,O;k(D:Y_}E0AND wner = 'Mr M A Gurry'ITPUB个人空间D6Z.O.KmVb
AND identifier = 14;ITPUB个人空间"N*wAG9n9G2E6x
9J"gsr;f0S0APPENDITPUB个人空间{2p/r0T:m8MMw3P9m;}
Allows a direct path insert to a table. Data to be inserted bypasses the buffer cache, and is appended to the end of the table. Integrity constraints are ignored during the load, although I have observed that after the load has taken place, the integrity checks are made and your statement can still fail with an integrity constraint error.ITPUB个人空间!}g TsO(}
INSERT /*+ APPEND */ * INTO y
2k,w(rZ/N0SELECT FROM winners;
)S'L&w]A Sa0
g@OJ nXN%V~W0CACHE (table)ITPUB个人空间%}6JRDC~/|
Instructs the optimizer to position all blocks retrieved via a full table scan at the most recently used end of the LRU (Least Recently Used) list in the buffer cache. You wouldITPUB个人空间,B3D-RBpKR2WF
f-t1A2fm0usually use this hint on small tables, but I have seen sites with a very large amount of memory cache very large tables that are infrequently changed.
ALL_ROWSITPUB个人空间TV Mak [s
Optimizes for least resource usageto return all rows required by the query. This hint will sometimes override a NESTED LOOP with a SORT MERGE or a HASH JOIN if applied to a SELECT, UPDATE, or DELETE statement when OPTIMIZER_MODE=CHOOSE.
3s ^h;D3];[0SELECT /*+ ALL_ROWS */ ...
GVJ*GN%g0ITPUB个人空间,nTX)h Nbx
AND_EQUAL (table index1 index2[... index5])
pmI|vX)I0Explicitly merges single-column indexes. A minimum of two indexes must be specified, and no more than five are allowed. Single-column index merges can be incredibly inefficient if the first index in the WHERE returns a lot of rows.
OuN:aM0SELECT /*+ AND_EQUAL(horse_owners ho_ndx1
^ Ny;z2W}m0ho_ndx2 ho_ndx3) */ITPUB个人空间l6C Tyt*? Kf8tQ
count(*)ITPUB个人空间0b!r| BtMY8u
FROM horse_owners
6Q0vO.mZ0WHERE horse_name = 'WILD CHARM'
,O;k(D:Y_}E0AND wner = 'Mr M A Gurry'ITPUB个人空间D6Z.O.KmVb
AND identifier = 14;ITPUB个人空间"N*wAG9n9G2E6x
9J"gsr;f0S0APPENDITPUB个人空间{2p/r0T:m8MMw3P9m;}
Allows a direct path insert to a table. Data to be inserted bypasses the buffer cache, and is appended to the end of the table. Integrity constraints are ignored during the load, although I have observed that after the load has taken place, the integrity checks are made and your statement can still fail with an integrity constraint error.ITPUB个人空间!}g TsO(}
INSERT /*+ APPEND */ * INTO y
2k,w(rZ/N0SELECT FROM winners;
)S'L&w]A Sa0
g@OJ nXN%V~W0CACHE (table)ITPUB个人空间%}6JRDC~/|
Instructs the optimizer to position all blocks retrieved via a full table scan at the most recently used end of the LRU (Least Recently Used) list in the buffer cache. You wouldITPUB个人空间,B3D-RBpKR2WF
f-t1A2fm0usually use this hint on small tables, but I have seen sites with a very large amount of memory cache very large tables that are infrequently changed.