
|
[oracle-l]
||
[Date Prev]
[08-2004 Date Index]
[Date Next]
||
[Thread Prev]
[08-2004 Thread Index]
[Thread Next]
Re: SQL Tunning
- From: "Carel-Jan Engel" <cjpengel.dbalert@xxxxxxxxx>
- To: oracle-l@xxxxxxxxxxxxx
- Date: Mon, 2 Aug 2004 12:25:52 +0200 (CEST)
You can also create a function based index on TRUNC(last_update_date), but
w/o any changes to your tables and/or indexes rephrasing the query to
WHERE last_update_date BETWEEN TRUNC(SYSDATE - 1) AND TRUNC(SYSDATE -
1/86400)
will make an index-range scan possible. The 1/86400 is to subtract 1
second of the SYSDATE, to prevent including the 0:00:00 updates of today.
Regards, Carel-Jan
===
If you think education is expensive, try ignorance. (Derek Bok)
===
> Hello expert,
>
> I have a table with 40 millions records and the last update date is
> indexed. But when we use the
> following where clause, it takes forever to run the report.
>
> WHERE TRUNC(last_update_date) = TRUNC(SYSDATE - 1)
>
> How to improve the performance? Do I need to create a new index field on
> the table with TRUNC(last_update_date)?
> ----------------------------------------------------------------
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> ----------------------------------------------------------------
> To unsubscribe send email to: oracle-l-request@xxxxxxxxxxxxx
> put 'unsubscribe' in the subject line.
> --
> Archives are at http://www.freelists.org/archives/oracle-l/
> FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
> -----------------------------------------------------------------
>
----------------------------------------------------------------
Please see the official ORACLE-L FAQ: http://www.orafaq.com
----------------------------------------------------------------
To unsubscribe send email to: oracle-l-request@xxxxxxxxxxxxx
put 'unsubscribe' in the subject line.
--
Archives are at http://www.freelists.org/archives/oracle-l/
FAQ is at http://www.freelists.org/help/fom-serve/cache/1.html
-----------------------------------------------------------------
|

|