For Oracle support & training call (800) 766-1884
Free Oracle Tips

Home
Oracle Tips
Oracle Code Depot
Oracle Monitoring
Oracle Consulting
Oracle Training
Oracle News
Oracle Forum
Oracle Support





 

Free Oracle Tips

image

 
HTML Text

Free Oracle App Server Tips

image

 
HTML Text


Privacy Policy

Redneck

Dress Code

Oracle tuning

Oracle training

Oracle support

Remote Oracle


 

   
  SQL Server Tips by Burleson

Wonder Shorthands

SQL also came up with some wonder "shorthands" that improve the readability of the code. The logical operator "x BETWEEN y AND z" means "((y <= x) AND (x <= z))" -- note the order of comparison and the inclusion of the endpoints of the range. Likewise, "x IN (a,b,c,..)" expands out to "((x = a) OR (x = b) OR (x = c) OR ...)" at run time.

Most SQL engines are pretty good about optimizing the predicates and not that good about optimizing calculations. For example, the engine might not change (x + 0) or (x * 1) to (x) when they are compiling the code. This means that you need to write very clear logical expression with the simplest calculations in SQL.

Procedural languages like Fortran or Pascal are very good about optimizing calculations, which only makes sense because all they do is calculations! But SQL is a data retrieval language and the goal is to get back the right set of data as fast as possible from the secondary storage. Calculations are done at the speed of electricity, while data is retrieved by mechanical disk reads. The biggest improvements come from faster retrieval methods, not improved calculations.


This is a book excerpt from:

Advanced SQL Database Programmer Handbook

Donald K. Burleson, Joe Celko, John Paul Cook, Peter Gulutzan

ISBN: 0-9744355-2-X

http://www.rampant-books.com/ebook_dbazine_SQL_prog.htm
 

  
 

 
 
 
 
Oracle performance tuning software
 
 

 

 
 
 
Oracle performance Tuning 10g reference poster
 
 
 
Oracle training in Linux commands
 
Oracle training Excel
 
Oracle training & performance tuning books
 

 

Fast-Track Oracle Support
PO Box 511
Kittrell, NC 27544


Email BC:

 

Hit Counter