Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Mailing Lists -> Oracle-L -> SQL Optimizer
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
-- http://www.freelists.org/webpage/oracle-lReceived on Mon Sep 10 2007 - 10:37:21 CDT