Wednesday 12 October 2011

HINTS

{\rtf1\ansi\ansicpg1252\deff0\deflang16393{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\fswiss\fprq2\fcharset0 Tahoma;}{\f2\fnil\fcharset0 Calibri;}}
{\colortbl ;\red51\green51\blue153;\red0\green0\blue0;\red51\green51\blue204;}
{\stylesheet{ Normal;}{\s1 heading 1;}{\s2 heading 2;}{\s3 heading 3;}{\s4 heading 4;}{\s5 heading 5;}{\s6 heading 6;}{\s7 heading 7;}{\s8 heading 8;}}
{\*\generator Msftedit 5.41.21.2509;}\viewkind4\uc1\pard\tx900\lang1033\f0\fs22\par
\pard\li720 Hints are \b suggestions\b0 that you give the optimizer for optimizing a SQL statement.\v\par
\v0 Hints allow you to make decisions usually made by the optimizer.\v\par
\v0 You can use \b hints\b0 to specify:\par
\pard\fi-360\li1440\tx1440 Optimization approach for a SQL statement\par
Goal of the cost-based approach for a SQL statement\par
Access path for a table accessed by the statement\par
Join order for a join statement\par
A join operation in a join statement\par
\pard\li720 If you incorrectly specify a hint in any way, it will become a comment, and will be ignored. You can also use more than one hint at a time, although this may cause some or all of the hints to be ignored. \v\par
\v0 When you use an alias on a table that you want to use in a hint, you must specify the \b alias - \b0 NOT the \b table name\b0 in the hint.\par
\pard\keepn\s8\fi720\b Two MOST Used Hints\par
\pard\li720 The Ordered Hint \endash \b0 The ORDERED hint causes tables to be accessed in a particular order, based on the order of the tables in the FROM clause. The ORDERED hint guarantees the Driving Order of the Table Joins. \v\par
\v0 The ORDERED hint is one of the most \b powerful\b0 hints available. \v\par
\v0 When a multi-table join is slow and you don\rquote t know what to do \'85 this should be the \b first hint\b0 you should try!\par
\b The RULE Hint \endash\b0 The RULE Hint will force the optimizer to use Rule-Based Optimization.\cf1\f1\fs18 \cf2\v\f0\fs22\par
\pard\par
\par
\cf3\v0\f1\fs18\par
\pard\fi720\cf0\b\f0\fs22 Hints NOT to Use\par
\b0 Don't HINT to a specific \b INDEX-\b0\v\par
\pard\li720\v0 Index names can and do change frequently. DBA's restructure Indexes and change index names. \v\par
\pard\v0\par
\pard\li720 Never use the \b CACHE\b0 Hint- Tables and Indexes have been assigned to specific storage areas. Please don't cache anything - leave that up to the DBA's.\par
Never use the \b APPEND\b0 Hint- unless, the database uses parallel processing. This Hint will cause the table to be appended in Parallel Write Mode. If your Database is not in Parallel Mode - It will Trash the table\v\par
\pard\sa200\sl276\slmult1\cf3\v0\f1\fs18 \cf0\lang9\f2\fs22\par
}

No comments:

Post a Comment