Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> SQL Optimizer

SQL Optimizer

From: Bob Robert <mssql_2002_at_yahoo.com>
Date: Mon, 10 Sep 2007 08:37:21 -0700 (PDT)
Message-ID: <854938.83868.qm@web63909.mail.re1.yahoo.com>


Could you please comment on the following SQL queries between Original SQL and Modified SQL. It seems that modified SQL's are perfoming better but I don't know how exactly Oracle optimizer works.

Original Query1:
 SELECT *
  FROM orders
 WHERE orders_updt_dtm BETWEEN sysdate - 7 AND sysdate
/

Modified Query1:
SELECT *
  FROM orders
WHERE 7 >= sysdate - orders_last_updt_dtm
/

Original Query2:
SELECT *
  FROM sales
WHERE sales_updt_dtm BETWEEN sysdate - 7 AND sysdate
/

Modified Query2:
SELECT *
  FROM sales
 WHERE sales_updt_dtm >= sysdate - 7 - 0    AND sales_updt_dtm <= sysdate - 0
/

Thanks,
Bob        



Yahoo! oneSearch: Finally, mobile search that gives answers, not web links.
http://mobile.yahoo.com/mobileweb/onesearch?refer=1ONXIC
--
http://www.freelists.org/webpage/oracle-l
Received on Mon Sep 10 2007 - 10:37:21 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US