Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12345»»»

Do you know your getdate()? Expand / Collapse
Author
Message
Posted Wednesday, May 12, 2010 2:07 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, August 21, 2014 4:43 AM
Points: 870, Visits: 897
I get 3.3 ms here using your own code.

The worst part about it is you would have not given the job to someone who correctly responded with 3.3ms for GETDATE() precision


Karl
source control for SQL Server
Post #920233
Posted Wednesday, May 12, 2010 2:26 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Monday, August 25, 2014 8:03 AM
Points: 908, Visits: 203
If you get 15.6521 it does not mean that this is the precision of getdate()!

Why do you think that @Time and @TimeEnd have succesiv values?

The conclusion, in my opinion, is the your system is very good (count is only 595 so only 595 times @Time and @TimeEnd are different, on my system is gets 18475), but the load of you system is very high, your processor is taken by another process from time to time so you get a very big value for the "precision" (in my case is 3.34344).

Post #920239
Posted Wednesday, May 12, 2010 2:33 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Tuesday, August 27, 2013 1:23 PM
Points: 7, Visits: 23
matthieu.ravard (5/12/2010)
is the other instructions present in the code takes some millisecond ?


Doesn't matter as long as you get several loop iterations before the timer gives another value.
Post #920244
Posted Wednesday, May 12, 2010 2:35 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, February 19, 2013 2:02 AM
Points: 846, Visits: 303
WIN XP SP3 / SQL Server 2008 SP1 on dual core machine

getdate: 6043 3.3399 & 5957 3.33557
sysdatetime: 1713 15625 & 1789 15625


Regards,

Willem
http://wschampheleer.wordpress.com
Post #920246
Posted Wednesday, May 12, 2010 3:17 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Sunday, November 17, 2013 1:19 PM
Points: 29, Visits: 397
My results on a single Windows 2000 Professional SP4 machine:
- In SQL Server 2000 Query Analyzer: did not run within 5 minutes runtime, I do not understand why.
- In SQL Server 2000 SP4, via Access .ADP file: 1,418 / 15.62,
- In SQL Server 2005 SP2, via Access .ADP file: 789 / 15.62.

Hope, this adds to the discussion, Leendert.
Post #920279
Posted Wednesday, May 12, 2010 3:24 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Sunday, November 17, 2013 1:19 PM
Points: 29, Visits: 397
P.S. I was too impatient: the very same Windows 2000 Professional SP4 machine, SQL Server 2000 Query Analyzer, after 7:44 minutes: 27,553 / 16.8266. The Access .ADP file return results after 12–22 sec.

I stop trying to understand all these differences, Leendert.
Post #920288
Posted Wednesday, May 12, 2010 6:49 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Wednesday, August 27, 2014 10:38 AM
Points: 80, Visits: 723
From my XP workstation, running the first query only, if I connect to my local SQL 2008 install then I get the 3.3333 time. If I connect to our Server's SQL 2005 install, I get the 15.6xxx time.

Just wanted to share my experience.
Post #920410
Posted Wednesday, May 12, 2010 7:19 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, March 29, 2011 2:59 PM
Points: 473, Visits: 606
Wow.
I did not expect to get so many posts before I even show up for work.
Looking at all the replies, one potential explanation for some of the 'better' precision numbers for GETDATE() might be possible.
64 bit OS.
Looks like whoever run the tests on 64 bit OS got the 3.33 ms precision and whoever run it on 32 bit got ~16 ms presicion.

If anyone of you got the 3.33 ms on a 32 bit box please reply with more specifics on the OS, CPU and SQL Server version. I don't think anything else could explain the difference. I did to run the tests on different configurations but I have to admit I did not have access to a 64 bit OS.


---------------------------------------------
Nothing is impossible.
It is just a matter of time and money.
Post #920446
Posted Wednesday, May 12, 2010 7:24 AM
SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, February 19, 2013 2:02 AM
Points: 846, Visits: 303
I got 3.33 ms on a 32bit OS: WIN XP SP3 / SQL Server 2008 SP1 on dual core machine (Intel T2500).

Regards,

Willem
http://wschampheleer.wordpress.com
Post #920450
Posted Wednesday, May 12, 2010 7:25 AM
SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Tuesday, March 29, 2011 2:59 PM
Points: 473, Visits: 606
SQLZ (5/12/2010)
I get 3.3 ms here using your own code.

The worst part about it is you would have not given the job to someone who correctly responded with 3.3ms for GETDATE() precision


Well, life is tough.

But seriously, back then, when I was in the position to interview people I did not care as much what knowledge did they have but rather what could they do with it.


---------------------------------------------
Nothing is impossible.
It is just a matter of time and money.
Post #920453
« Prev Topic | Next Topic »

Add to briefcase ««12345»»»

Permissions Expand / Collapse