Groups > DB2 > DB2 MVS > CURRENT DATE performance vs hard coded date




CURRENT DATE performance vs hard coded date

CURRENT DATE performance vs hard coded date
Thu, 21 Feb 2008 11:09:37 EST
I'm trying to find the better SQL to get the best performance from DB2 using a
TIME_STAMP column. Below are the 4 options I've tried in my WHERE clause to
extract rows and it seems the 4th is the best. Does anyone ever tried any of
these and why. Using the CURRENT DATE,CURRENT TIMESTAMP is the   worse in terms
of performance and I was thinking that DB2 might evaluate it for each and every
compare to a row? And the caveat here is if the job, say runs past the midnight
time, does the CURRENT evaluates to the new date?<br />
Many thanks.<br />
<br />
Four options:<br />
1. Convert the timestamp col to a date then use CURRENT DATE<br />
2. Convert the timestamp col to a date then use something like &gt;
'CCYY-MM-DD'<br />
3. INSERT_TIMESTAMP &gt; CURRENT TIMESTAMP<br />
Post Reply
about | contact