|
|
|
|
|
|
|
|
-
Adam Tokarski Commented 1 Years ago through Puzzles | 1 Point
@dishdy: for generate data? Probably yes.
But I asked about castlings solutions. I was curious how did he managed to get these stats.
|
-
Adam Tokarski Commented 1 Years ago through Puzzles | 1 Point
@castling: Quite interesting numbers. Does your v2 use windowed sum (that with order by)?
|
-
Adam Tokarski Commented 1 Years ago through Puzzles | 1 Point
@castling & @dishdy:
So, the same as mine: 39472793540 and 4995005,78. Good!
I've got no idea, why previous check gave different sum.
|
-
Adam Tokarski Commented 1 Years ago through Puzzles | 1 Point
@dishdy: will you be rearranging your script to be working also at servers 2008?
So, with data from script v3, SUM is 39469881225.
|
-
Adam Tokarski Commented 1 Years ago through Puzzles | 1 Point
I'm afraid, ntile is not problem at 2008r2.
That
sum(Range + Hole) over (partition by PatientID order by N)
does not work.
|
-
Adam Tokarski Commented 1 Years ago through Puzzles | 1 Point
Using that last script, my stats:
SQL Server parse and compile time:
CPU time = 0 ms, elapsed time = 0 ms.
(61968 row(s) affected)
Table 'Worktable'. Scan count 3, logical reads 447873, physical reads 0, read-ahead reads 0,
|
-
Adam Tokarski Commented 1 Years ago through Puzzles | 1 Point
But, also, I have faster version. Only problem is, that new PatientId are ascending.
And, when I tried to check it SUM(PatientId) it happens:
Arithmetic overflow error converting expression to data type int.
Script, v3:
TRUNCATE TA
|