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 is fastest? To_Date.. or Trunc...

Re: Which is fastest? To_Date.. or Trunc...

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sun, 1 Aug 1999 09:46:17 +0100
Message-ID: <933498012.5363.0.nnrp-01.9e984b29@news.demon.co.uk>


Try this (done on 8.0.4)

declare

    v_date date;
    m_date varchar2(20);
begin

    for i_ct in 1..10000 loop

Time for the trunc version: 441 milliseconds Time for the to_char version: 661 milliseconds

Conclusion: on 10,000 iterations, trunc is 200 milliseconds faster . Doesn't seem worth worrying about really.

--

Jonathan Lewis
Yet another Oracle-related web site: www.jlcomp.demon.co.uk

Magnus wrote in message <37A2105D.C2106A39_at_eudoramail.comREMOVETHIS>...
>Hi,
>
>I have seen a couple of questions on comparing dates. Some recommend
>To_Date and some recommend Trunc to get rid of the "time-part" of the
>dates in the comparision. Does anyone know which is fastest when the
>query runs?
>
>Thanks!
>
>/Magnus
>
Received on Sun Aug 01 1999 - 03:46:17 CDT

Original text of this message

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