| Start | ||||||
|---|---|---|---|---|---|---|
| Parallel Hint Statement-level parallel hints are the easiest: Object-level parallel hints give more control but are more prone to errors; developers often forget to use the alias instead of the object name, or they forget to include some objects.
Let's say a query takes 100 seconds to execute without using parallel hint. If we change DOP to 2 for same query, then ideally the same query with parallel hint will take 50 second. Similarly using DOP as 4 will take 25 seconds. In practice, parallel execution depends on many other factors and does not scale linearly. This is especially true for small run times where the parallel overhead may be larger than the gains from running in multiple parallel servers. |
||||||
| USE_NL Use Nested Loops. Usage : This hint will ask the engine to use nested loop method to join the tables A and B. That is row by row comparison. The hint does not force the order of the join, just asks for NL. |
||||||
| APPEND HINT "Use DIRECT PATH method for inserting new rows". The
Example. |
||||||
| USE_HASH Instructs the engine to use hash method to join tables in the argument. Usage : As explained (opens new window) in many (opens new window) places (opens new window), "in a HASH join, Oracle accesses one table (usually the smaller of the joined results) and builds a hash table on the join key in memory. It then scans the other table in the join (usually the larger one) and probes the hash table for matches to it." It is preferred against Nested Loops method when the tables are big, no indexes are at hand, etc. Note: The hint does not force the order of the join, just asks for HASH JOIN method. Example of usage: |
||||||
| FULL The FULL hint tells Oracle to perform a full table scan on a specified table, no matter if an index can be used. With no hints, the index is used: FULL hint forces a full scan: |
||||||
| Result Cache Oracle (11g and above) allows the SQL queries to be cached in the SGA (opens new window) and reused to improve performance. It queries the data from cache rather than database. Subsequent execution of same query is faster because now the data is being pulled from cache. Output - If I run the same query again now, the time to execute will reduce since the data is now fetched from cache which was set during the first execution. Output - Notice how the elapsed time reduced from 2.20 seconds to 0.10 seconds. Result Cache holds the cache until the data in database is updated/altered/deleted. Any change will release the cache. Parameters
|
Read Article
https://develop.horje.com/learn/1434/reference