<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Loving LINQ</title><link>http://blogs.msdn.com/simonince/archive/2007/10/30/loving-linq.aspx</link><description>I have to say, I love how easy it is to do SQL-like expressions over collections of objects with LINQ... If we have two simple classes that define our data; class Person { public int Id { get ; set ; } public string Name { get ; set ; } public int AddressId</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: Loving LINQ</title><link>http://blogs.msdn.com/simonince/archive/2007/10/30/loving-linq.aspx#5805354</link><pubDate>Thu, 01 Nov 2007 00:40:43 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5805354</guid><dc:creator>Bart Czernicki</dc:creator><description>&lt;p&gt;Nice intro article. &amp;nbsp;However, ur paragraph on the bottom, couldn't be further from the truth about large collections :) &amp;nbsp;&lt;/p&gt;
&lt;p&gt;My tests show 100x improvements when working with LINQ in memory with larger collection sets (&amp;gt; 200,000 rows), without any optimizations!!!&lt;/p&gt;
&lt;p&gt;- add in custom indexes (i.e. Hash indexes)&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://blog.magenic.com/blogs/aarone/archive/2007/04/09/Introducing-i4o.aspx"&gt;http://blog.magenic.com/blogs/aarone/archive/2007/04/09/Introducing-i4o.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;- PLINQ (coming soon to a developer near u, some people aready have the bits)&lt;/p&gt;
&lt;p&gt;&lt;a rel="nofollow" target="_new" href="http://spellcoder.com/blogs/bashmohandes/archive/2007/10/14/8530.aspx"&gt;http://spellcoder.com/blogs/bashmohandes/archive/2007/10/14/8530.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;- make ur own custom Expression trees optimized&lt;/p&gt;
&lt;p&gt;You get even faster results! &amp;nbsp;PLINQ and hash indexes are just sick on performance. &amp;nbsp;Check out the SQL 2005 Optimizations book on how SQL handles Hash joins and how they are preferred for large data sets and u can do the same for LINQ!!!&lt;/p&gt;
&lt;p&gt;I have queries that take 6 seconds to run in SQL Server coming back in 27ms...(no I am not missing a zero)&lt;/p&gt;</description></item><item><title>re: Loving LINQ</title><link>http://blogs.msdn.com/simonince/archive/2007/10/30/loving-linq.aspx#5832981</link><pubDate>Fri, 02 Nov 2007 13:35:22 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:5832981</guid><dc:creator>simonince</dc:creator><description>&lt;p&gt;Yes, I should probably have qualified that comment a bit further! I take your points - and I have to say the indexing ideas are very interesting, and potentially fantastically useful in some situations - but I'd still advise caution.&lt;/p&gt;
&lt;p&gt;My main concern is in multi-user scenarios - e.g. ASP.NET. The idea of many users pulling back 200,000 objects each, joining them in memory concurrently, etc, etc... watch that scalability plunge! I'm keen that people understand what LINQ is doing - when it is optimising a SQL query, and when it is just operating in memory, as misunderstanding this could leave you with a headache.&lt;/p&gt;
&lt;p&gt;On the other hand, database servers (although incredibly advanced) are not magical - the fact is they have to do a lot of processing that can be simulated in .NET code... so if you write something approaching the same algorithms, but don't have the overhead of network or cross process communication, serialization, and so on, I can completely believe that in some scenarios you can beat a SQL server.&lt;/p&gt;
&lt;p&gt;We also shouldn't forget that there is no like-for-like comparison here. SQL can balance reads with writes, can scale up massively, has availability and recovery options, etc, etc... so as usual I suppose it is a case of picking your approach according to the best fit at the time!&lt;/p&gt;
</description></item></channel></rss>