Call now: 252-767-6166  
Oracle Training Oracle Support Development Oracle Apps

 
 Home
 E-mail Us
 Oracle Articles
New Oracle Articles


 Oracle Training
 Oracle Tips

 Oracle Forum
 Class Catalog


 Remote DBA
 Oracle Tuning
 Emergency 911
 RAC Support
 Apps Support
 Analysis
 Design
 Implementation
 Oracle Support


 SQL Tuning
 Security

 Oracle UNIX
 Oracle Linux
 Monitoring
 Remote s
upport
 Remote plans
 Remote
services
 Application Server

 Applications
 Oracle Forms
 Oracle Portal
 App Upgrades
 SQL Server
 Oracle Concepts
 Software Support

 Remote S
upport  
 Development  

 Implementation


 Consulting Staff
 Consulting Prices
 Help Wanted!

 


 Oracle Posters
 Oracle Books

 Oracle Scripts
 Ion
 Excel-DB  

Don Burleson Blog 


 

 

 


 

 

 
 

Oracle good hints list

Oracle Database Tips by Donald BurlesonUpdated January 7, 2015

Oracle Good Hints List

Question:  Could you share your good hints list please?  Some Oracle people say that there are "good" and bad" hints, but I don't agree that some hints like the ordered hint belong on the bad hint list.

Answer:  If the Oracle optimizer always made correct guesses about the size of internal result sets, hints would be far less common, but make no mistake, it's impossible for any software product to always make the correct guess, based on the limited information in the data dictionary.

I have the ordered hint on my good hint list because there are times when I know better than the optimizer about the future state of the tables, and in cases where the is one, and only one optimal table join order, the ordered hint is a good hint because it can save the optimizer a huge amount of processing at parse time, especially for SQL that joins more than 10 tables.

Good hint or bad hint, hints as a last-resort and your should always try to find the rot cause of your suboptimal plan (stale/missing statistics, wrong optimizer_mode), etc.

When the optimizer makes a mistake, it's very tempting to add a "good" hint, and move the SQL into production.  In practice, while your sub-optimal SQL is not a huge issue, it is a symptom of a much larger issue, and fixing your execution plan may also have the side effect of improving the execution plans of thousands of other SQL statements!

There are "good" hints, those that help the optimizer make a better decision. 

The global optimizer mode hints (all_rows, first_rows_1, first_rows_10, first_rows_100, first_rows_1000) are good hints because they are used when the majority of the SQL workload is optimal, but there are "outlier" SQL that needs a different optimizer mode.

The only exceptions are hints that give "a priori" information to the CBO like these good hints:

Don Burleson good hint list:

  • append
  • (no)append
  • parallel
  • (no)parallel
  • rewrite
  • (no)rewrite
  • all_rows
  • cardinality
  • cpu_costing
  • cursor_sharing_exact
  • driving_site
  • dynamic_sampling
  • first_rows_1
  • first_rows_10
  • first_rows_100
  • first_rows_1000
  • opt_param
  • ordered
  • ordered_predicates
  • selectivity
  • skip_ext_optimizer

Of course, you could argue that the CBO would not need some good hints (e.g. number of rows returned by query, table join order, etc.), but sometimes there is no substitute for a-priori knowledge.

 
If you like Oracle tuning, you may enjoy my bestselling book Oracle Tuning: The Definitive Reference", with over 900 pages of BC's favorite tuning tips & scripts. 

You can buy it direct from the publisher for 30%-off and get instant access to the code depot of Oracle tuning scripts.



 

 

��  
 
 
Oracle Training at Sea
 
 
 
 
oracle dba poster
 

 
Follow us on Twitter 
 
Oracle performance tuning software 
 
Oracle Linux poster
 
 
 

 

Burleson is the American Team

Note: This Oracle documentation was created as a support and Oracle training reference for use by our DBA performance tuning consulting professionals.  Feel free to ask questions on our Oracle forum.

Verify experience! Anyone considering using the services of an Oracle support expert should independently investigate their credentials and experience, and not rely on advertisements and self-proclaimed expertise. All legitimate Oracle experts publish their Oracle qualifications.

Errata?  Oracle technology is changing and we strive to update our BC Oracle support information.  If you find an error or have a suggestion for improving our content, we would appreciate your feedback.  Just  e-mail:  

and include the URL for the page.


                    









Burleson Consulting

The Oracle of Database Support

Oracle Performance Tuning

Remote DBA Services


 

Copyright © 1996 -  2020

All rights reserved by Burleson

Oracle ® is the registered trademark of Oracle Corporation.