RE: SUSPECT: RE: new p[roblem

RE: SUSPECT: RE: new p[roblem

 

  

Ah. Put the GetDate() into a variable, then use the variable in the WHERE clause.

I think it's getting the time for each row.

P

-----Original Message-----
From: Singh Kanwar
[mailto:mssqldba-ezmlmshield-x85857160.[Email address protected]
Sent: Thursday, November 25, 2004 12:08 PM
To: LazyDBA Discussion
Subject: SUSPECT: RE: new p[roblem


Sorry here is where clause

WHERE getdate() BETWEEN StartEffectiveDate
AND isNull(EndEffectiveDate,getdate())

-----Original Message-----
From: Singh Kanwar
[mailto:mssqldba-ezmlmshield-x68156095.[Email address protected]
Sent: Thursday, November 25, 2004 10:02 AM
To: LazyDBA Discussion
Subject: new p[roblem

I have a very small 180K rows table with clustered index on
startEffectiveDate,EndEffectiveDate. Still when I run select statement
with this where clause it takes 49 seconds. Which is way too much and
not acceptable.
Please help?

Thanks

Kanwar


---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]



---------------------------------------------------------------------
TO REPLY TO EVERBODY , PLEASE CLICK REPLY-ALL, NOT JUST REPLY
Website : http://www.LazyDBA.com
To unsubscribe: http://www.lazydba.com/unsubscribe.html
For additional commands, e-mail: mssqldba-[Email address protected]



MS Sql Server LazyDBA home page