Tema: Re: Performance test results (kb)
Autorius: Jornada Del Muerto
Data: 2010-08-12 16:32:54
1 Klaida oupute 3 testas su cast char, nucopypastijau ir nebuvau pakeites, nors rezultatai ir sql geras, cia pataisyta :)
---------------------------------------------------------------------------------------------------
--- TESTS STARTING 1000000 of cycles
---------------------------------------------------------------------------------------------------
method: cast(floor(cast(getdate() as float)) as datetime): 1313 /[2010-08-12 16:32:27.527]-[2010-08-12 16:32:28.840]
method: DateAdd(dd, 0, DateDiff(dd, 0, getdate())): 1246 /[2010-08-12 16:32:28.840]-[2010-08-12 16:32:30.087]
method: CAST(CONVERT(CHAR(10), getDate(), 25) AS DATETIME): 2370 /[2010-08-12 16:32:30.087]-[2010-08-12 16:32:32.457]
---------------------------------------------------------------------------------------------------
Time in MS, FLOOR=1313ms, Datediff=1246ms, CAST CHAR=2370ms
---------------------------------------------------------------------------------------------------
(1 row(s) affected)
(1 row(s) affected)
(1 row(s) affected)
---------------------------------------------------------------------------------------------------
-- Best result is: select DateAdd(dd, 0, DateDiff(dd, 0, getDate()))
---------------------------------------------------------------------------------------------------