<?xml version="1.0" encoding="utf-8" ?>
<?xml-stylesheet type="text/xsl" href="RSS_xslt_style.asp" version="1.0" ?>
<rss version="2.0" xmlns:WebWizForums="http://syndication.webwiz.co.uk/rss_namespace/">
 <channel>
  <title>DevForce Community Forum : Query Performance</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Query Performance</description>
  <pubDate>Wed, 13 May 2026 21:40:15 -700</pubDate>
  <lastBuildDate>Tue, 09 Aug 2011 15:19:42 -700</lastBuildDate>
  <docs>http://blogs.law.harvard.edu/tech/rss</docs>
  <generator>Web Wiz Forums 9.69</generator>
  <ttl>360</ttl>
  <WebWizForums:feedURL>www.ideablade.com/forum/RSS_post_feed.asp?TID=2870</WebWizForums:feedURL>
  <image>
   <title>DevForce Community Forum</title>
   <url>http://www.ideablade.com/forum/forum_images/IdeaBlade_logo_tm.png</url>
   <link>http://www.ideablade.com/forum/</link>
  </image>
  <item>
   <title>Query Performance :   Hi Vonzkie,Entity Framework...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2870&amp;PID=11380#11380</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2870<br /><strong>Posted:</strong> 09-Aug-2011 at 3:19pm<br /><br />Hi Vonzkie,<div></div><div>Entity Framework is slightly faster than DevForce considering DevForce has some overhead over EF and is optmized for n-tier.</div><div>&nbsp;</div><div>A&nbsp;few suggestions:</div><div>&nbsp;</div><div>1) Try turning Query Inversion off:</div><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"></font></font>&nbsp;</div><div><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">orderquery.QueryStrategy = </font></font><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas"><font color="#0000ff" size="2" face="C&#111;nsolas">new</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas"> </font></font><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas">QueryStrategy</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">(context.DefaultQueryStrategy.FetchStrategy, context.DefaultQueryStrategy.MergeStrategy, </font></font><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas"><font color="#2b91af" size="2" face="C&#111;nsolas">QueryInversionMode</font></font></font><font size="2" face="C&#111;nsolas"><font size="2" face="C&#111;nsolas">.Off);</font></font><br></div><div>You can find more information about query inversion in the <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/query-inversi&#111;n" target="_blank">DevForce Resource Center</a>.</div><div>&nbsp;</div><div>2) You could also try querying a reasonable number the entities, i.e. 50, after async querying for everything<br></div><div>3) As a last resource, you could always user SqlDataReader to populate a POCO. You can store POCOs in the EntityManager's cache and query them. You can find additional information about POCOs in our <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/POCOs" target="_blank"><u><font color="#0066cc">DevForce Resource Center</font></u></a>. There is nothing wrong with falling back to SqlDataReader occasionally, using it in a few places for hot spot performance improvements.<br></div><div>&nbsp;</div><div>Silvio.</div>]]>
   </description>
   <pubDate>Tue, 09 Aug 2011 15:19:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2870&amp;PID=11380#11380</guid>
  </item> 
  <item>
   <title>Query Performance : Hi,I tested it in a 2-tier environment...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2870&amp;PID=11365#11365</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1228" rel="nofollow">Vonzkie</a><br /><strong>Subject:</strong> 2870<br /><strong>Posted:</strong> 06-Aug-2011 at 8:17am<br /><br />Hi,<div><br></div><div>I tested it in a 2-tier environment by setting the isDistributed property to false.</div><div><br></div><div>Thanks,</div><div>Von</div>]]>
   </description>
   <pubDate>Sat, 06 Aug 2011 08:17:02 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2870&amp;PID=11365#11365</guid>
  </item> 
  <item>
   <title>Query Performance :   Hi Von,When you tested using...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2870&amp;PID=11364#11364</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=892" rel="nofollow">sbelini</a><br /><strong>Subject:</strong> 2870<br /><strong>Posted:</strong> 05-Aug-2011 at 3:36pm<br /><br />Hi Von,<div>&nbsp;</div><div>When you tested using DevForce, were you doing in 2-tier or n-tier?</div><div>&nbsp;</div><div>Silvio.</div>]]>
   </description>
   <pubDate>Fri, 05 Aug 2011 15:36:10 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2870&amp;PID=11364#11364</guid>
  </item> 
  <item>
   <title>Query Performance : Hi,Another thing is that, when...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2870&amp;PID=11358#11358</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1228" rel="nofollow">Vonzkie</a><br /><strong>Subject:</strong> 2870<br /><strong>Posted:</strong> 03-Aug-2011 at 7:16pm<br /><br />Hi,<div><br></div><div>Another thing is that, when I used the native Entity Framework it only took me a second to load</div><div>50k records.</div><div><br></div><div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>NorthwindIBEntities </b>context = new <b>NorthwindIBEntities</b>();</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; var query = context.Orders.Take(50000);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>List</b>&lt;Order&gt; orders = query.ToList&lt;Order&gt;();</div></div><div><br></div><div>I rewrite my Devforce query to this one and it took me 7 seconds to load it, faster than my first approach but still far behind the performance of native EF4 and this query is not async:</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<b>NorthwindIBEntities </b>_context = new <b>NorthwindIBEntities</b>();</div><div><br></div><div><span ="Apple-tab-span" style="white-space:pre">	</span>&nbsp; &nbsp;&nbsp;<b>IEntityQuery</b>&lt;Order&gt; orderquery = _context.Orders.Take(50000);</div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <b>List</b>&lt;Order&gt; orders = orderquery.ToList&lt;Order&gt;();</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>&nbsp; &nbsp;&nbsp;</div><div><br></div><div>Kindly give me some guide on how to accomplish same performance as the native EF4 because we are very particular with the performance because we are not only dealing with thousands of records but millions.</div><div><br></div><div>Thanks,</div><div>Von</div>]]>
   </description>
   <pubDate>Wed, 03 Aug 2011 19:16:36 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2870&amp;PID=11358#11358</guid>
  </item> 
  <item>
   <title>Query Performance : Hi,Using the NorthwindIB database,...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2870&amp;PID=11357#11357</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1228" rel="nofollow">Vonzkie</a><br /><strong>Subject:</strong> 2870<br /><strong>Posted:</strong> 03-Aug-2011 at 6:36pm<br /><br />Hi,<div><br></div><div>Using the NorthwindIB database, I inserted 50k records in Order Table.</div><div><br></div><div>When I used the native SQL Adapter, it only took me a second to fetch the data.</div><div><br></div><blockquote ="webkit-indent-blockquote" style="margin: 0 0 0 40px; border: n&#111;ne; padding: 0px;"><div><div><b>SqlDataAdapter </b></div>adap = new <b>SqlDataAdapter</b>("SELECT TOP 50000 * FROM dbo.&#091;Order&#093;", @"Data Source=IVON\SQL2008R2;Initial Catalog=NorthwindIB;Integrated Security=SSPI;");</div><div><div><br></div></div><div><div><b>DataSet </b></div>dt = new <b>DataSet</b>();</div><div><br></div><div>adap.Fill(dt);</div></blockquote><div><br></div><div>But when I execute this query using Devforce:</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<b>NorthwindIBEntities </b>_context = new <b>NorthwindIBEntities</b>();</div><div><span ="Apple-tab-span" style="white-space:pre">	</span>&nbsp;&nbsp;var orderquery = _context.Orders.Select(p =&gt; p).OrderBy(p =&gt; p.OrderID).Skip(0).Take(50000);<span ="Apple-tab-span" style="white-space:pre">	</span></div><div><span ="Apple-tab-span" style="white-space:pre">	</span></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;&nbsp;_context.ExecuteQueryAsync(orderquery, p =&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (!p.HasError)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // My code here..</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }, null);</div><div><br></div><div>It took me 30 seconds to finish the async query..</div><div><br></div><div>Why is this so? Am I missing some configuration or performance tips?</div><div>Another, when I use the SQL Profiler to get the SQL query provided by Entity Framework and execute it in the Management Studio, it also took me a second to finish it.</div><div><br></div><div>Your help is highly appreciated. :)</div><div><br></div><div>Thanks,</div><div>Von&nbsp;</div>]]>
   </description>
   <pubDate>Wed, 03 Aug 2011 18:36:01 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2870&amp;PID=11357#11357</guid>
  </item> 
 </channel>
</rss>