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

Home -> Community -> Usenet -> c.d.o.server -> Re: Performance: Dates vs Varchar2

Re: Performance: Dates vs Varchar2

From: John Russell <netnews2_at_johnrussell.mailshell.com>
Date: Thu, 14 Feb 2002 09:28:05 GMT
Message-ID: <lf0n6u0vd9os4lh124rjtgj58pkpt1decl@4ax.com>


On 13 Feb 2002 08:08:38 -0800, barnest_at_san.rr.com (Tom Barnes) wrote:
>A. Store the event time/date in a DATE field, index this field, and
>have a where-clause like this:
>"where eventTime between to_date('02/13/2002','MM/DD/YYYY') and
>to_date('02/13/2002 23:59:59','MM/DD/YYYY HH24:MI:SS')"

Why not use WHERE TRUNC(eventTime) = to_date(...)? That cuts the number of possibilities down to a reasonable number and avoids < and > operations. You could store TRUNC(eventTime) in its own column, or build a function-based index on the result of TRUNC(eventTime) for each row.

John

--
Got an Oracle database question?
Try the search engine for the database docs at:
http://tahiti.oracle.com/
Received on Thu Feb 14 2002 - 03:28:05 CST

Original text of this message

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