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 -> which way is faster?

which way is faster?

From: robotech <NOSPAMrobotech_at_asia1.com>
Date: Sun, 4 Aug 2002 11:20:03 +0800
Message-ID: <aii5uj$lgl$1@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:20:03 CDT

Original text of this message

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