Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Which is fastest? To_Date.. or Trunc...
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
![]() |
![]() |