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

Home -> Community -> Usenet -> c.d.o.misc -> Re: which way is faster?

Re: which way is faster?

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Sun, 04 Aug 2002 03:29:48 GMT
Message-ID: <Mc139.242203$Wt3.231331@rwcrnsc53>


2 is faster because it does not have to apply a function to each date "robotech" <NOSPAMrobotech_at_asia1.com> wrote in message news:aii5uj$lgl$1_at_mango.singnet.com.sg...
> Dear All
>
> Q1) I would like to check if anyone knows which of the below 2 ways will/
> should be faster.
> Pls assume no index & all things being equal.
>
> SELECT *
> FROM table
>
> (1) where trunc(sent_date) between '07-APR-2002' and '13-APR-2002';
>
> (2) where sent_date < '14-APR-2002'
> and sent_date >= '07-APR-2002';
>
>
> I have tried on a 3million records table and the result is
> (1) takes 2hr 15min
> (2) takes 1hr
>
> I am assuming now that (1) is slow due to trunc.
>
> Q2) So if sent_date have data in 'DD-MON-RRRR HH24:MI:SS'
> is this statement
> where sent_date between '07-APR-2002' and '13-APR-2002'
> the same as (2) above
>
>
> Pls advise
> Many Thanks
>
>
> newbie
>
>
>
Received on Sat Aug 03 2002 - 22:29:48 CDT

Original text of this message

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