-
The input table always contains consecutive values in the level column, starting from 0?
|
-
Is there a maximum level to be dealt with - what data type are you expecting for the carpet output ?
|
-
The input table always contains consecutive values in the level column, starting from 0?
No.
Is there a maximum level to be dealt with - what data type are you expecting for the carpet output ?
There is no maximum limit (output type - varchar(max))
|
-
I would assume that 20 is logical possible maximum - carpet grows 3 times every iteration and 3^19 is 1 162 261 467 and it's the biggest power of 3 lower than 2^31 - 1, which is varchar(max)'s limit.
I don't expect, however, anyone trying to output over a billion of rows, each of them over 1 GB in size :)
My laptop is slow generating carpets of level 7 - takes 7 seconds to accomplish that, but it's not the strongest machine in the universe (Pentium Dual Core T2370, 2 GB RAM, 200 GB HDD). Level 8 runs over a minute, I'll have to review it.
|
-
My stats here
(13 row(s) affected)
Table 'TC56'. Scan count 28, logical reads 28, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'tsqlc_Tally'. Scan count 316, logical reads 1503, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
SQL Server Execution Times:
CPU time = 77 ms, elapsed time = 76 ms.
|
-
Lets make stats more interesting:
INSERT INTO TC56(id,level)
SELECT 1, 0 UNION ALL
SELECT 2, 7 UNION ALL
SELECT 3, 9 UNION ALL
SELECT 4, 8 UNION ALL
SELECT 5, 7
So my stats here:
(30619 row(s) affected)
Table 'Worktable'. Scan count 6, logical reads 616417, physical reads 0, read-ahead reads 0, lob logical reads 126667, lob physical reads 0, lob read-ahead reads 0.
Table 'TC56'. Scan count 30548, logical reads 30548, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
SQL Server Execution Times:
CPU time = 14531 ms, elapsed time = 44659 ms.
|
-
Standard input:
Table 'Worktable'. Scan count 2, logical reads 79, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'TC56'. Scan count 15, logical reads 15, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
SQL Server Execution Times:
CPU time = 15 ms, elapsed time = 13 ms.
Mario's data:
Table 'Worktable'. Scan count 2, logical reads 177145, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
Table 'TC56'. Scan count 29526, logical reads 29526, physical reads 0, read-ahead reads 0, lob logical reads 0, lob physical reads 0, lob read-ahead reads 0.
SQL Server Execution Times:
CPU time = 147187 ms, elapsed time = 186991 ms.
Mario, what's the machine you're testing on? :)
|
-
I tested this on virtual machine with 8 Processors (cores) and 32GB RAM, but behind is 4 x 4core x 2.7GHz, 40GB. Well, maybe I should test it on laptop (but I don't have it with me now) to get more ‘realistic’ stats.
Nevertheless, these stats are from my improved algorithm that deliberately uses more scans, but less memory (can become bottleneck on high levels).
|
-
Hello,
I've been checking my failed solutions and I'm surprised to see that the only reason for my submission (ID:4722) to fail was obvious problem with generating the basic sandbox. It looks like something went really wrong during the generation of that script.
Could somebody have a look on that for me please?
Thanks
|
lof
223
·
1% ·
201
|
|
-
@lof,
I will shortly send you the online URL to your sandbox which will allow you to test it 'exactly' the way the evaluation software does. That will help to figure out why it fails.
|
|