I've got a problem which you might be able to assist me with.
I've got this C# CLR implemented as a stored procedure in one of our databases. That database server is really fast (120GB RAM and 24 Intel Xeon 2,4GHz CPU's). The CLR basically:
1. Reads a table of 5million rows using a datareader
2. Does some calculations for each row
3. Stores the results to another table using SQL Bulk Insert
I've done some performance testing and the "bottleneck" seems to be the calculations. The strange thing though, which I can't wrap my head around, is that when I run the (almost) exact same code from a UnitTest the calculations are about 50x faster. My local
machine is fast (12GB RAM with 1 Intel Xeon 3,07GHz CPU).
The even stranger thing is that loading the data (step 1 above) is also faster on my local machine than on the SQL server through the SQL CLR stroed procedure.
Do you know what the problem might be or if this is expected behaviour.
View Complete Post