<?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 : Excessively large SQL with inheritance model</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : Excessively large SQL with inheritance model</description>
  <pubDate>Mon, 13 Apr 2026 00:07:00 -700</pubDate>
  <lastBuildDate>Thu, 02 Feb 2012 13:38:56 -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=3246</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>Excessively large SQL with inheritance model : Many thanks. Looks like injected...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3246&amp;PID=12610#12610</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1385" rel="nofollow">paul.gilbert</a><br /><strong>Subject:</strong> 3246<br /><strong>Posted:</strong> 02-Feb-2012 at 1:38pm<br /><br />Many thanks. Looks like injected base types will do the trick to give me the hierarchy that's needed, and avoid the issues I was experiencing.]]>
   </description>
   <pubDate>Thu, 02 Feb 2012 13:38:56 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3246&amp;PID=12610#12610</guid>
  </item> 
  <item>
   <title>Excessively large SQL with inheritance model : Hi Paul,  DevForce does not...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3246&amp;PID=12596#12596</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=11" rel="nofollow">kimj</a><br /><strong>Subject:</strong> 3246<br /><strong>Posted:</strong> 01-Feb-2012 at 10:44am<br /><br />Hi Paul,<DIV>&nbsp;</DIV><DIV>DevForce does not actually generate the SQL for a LINQ query, we delegate that to the Entity Framework.&nbsp;&nbsp; There are known issues with inheritance in EF, specifically with TPT style inheritance.&nbsp;&nbsp; Here's one article - <a href="http://blogs.msdn.com/b/ad&#111;net/archive/2010/08/17/per&#102;ormance-c&#111;nsiderati&#111;ns-when-using-tpt-table-per-type-inheritance-in-the-entity-framework.aspx" target="_blank">http://blogs.msdn.com/b/adonet/archive/2010/08/17/performance-considerations-when-using-tpt-table-per-type-inheritance-in-the-entity-framework.aspx</A>&nbsp;- but if you do a web search on EF inheritance&nbsp;you'll find many more.</DIV><DIV>&nbsp;</DIV><DIV>If you're using TPT inheritance and have control over the database, one option would be to instead use TPH or TPC style.</DIV><DIV>&nbsp;</DIV><DIV>If all you need inheritance for is behavior, you can do that&nbsp;in DevForce with an&nbsp;"injected base type".&nbsp; Here's more information - <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/model-custom-base-class" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/model-custom-base-class</A>.</DIV><DIV>&nbsp;</DIV><DIV>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 01 Feb 2012 10:44:56 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3246&amp;PID=12596#12596</guid>
  </item> 
  <item>
   <title>Excessively large SQL with inheritance model : I seem to be having some real...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=3246&amp;PID=12593#12593</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1385" rel="nofollow">paul.gilbert</a><br /><strong>Subject:</strong> 3246<br /><strong>Posted:</strong> 31-Jan-2012 at 10:46pm<br /><br />I seem to be having some real trouble with the SQL being generated for my first major project using DevForce in C#. It's mandated that an inheritance hierarchy be used, with a common base entity class that contains a unique entity Id and various change tracking information, as well as a couple of intermediate&nbsp;base classes for differentiating between 'system' tables and standard tables (along with various extra properties).<br><br>Now, however, as I start adding tables to my EDMX and wiring up the inheritence, I'm starting to get problems with excessively large SQL being generated, which rapdily becomes an OutOfMemoryException as more tables are added.&nbsp; It seems to particularly manifest if I do an Include, to include a related table information, or do a standard Where query, as in 'BaseEntities.OfType&lt;ChildClass&gt;.Where(...)'. <br><br>What I can see from the SQL being generated, is that DevForce seems to be doing 'LEFT OUTER JOINS' from the base entity class to every since table defined in the model, which is obviously not what I want.&nbsp; With the 'Where' I'm explicitly telling it that I want objects of the given child class type, so I would have thought the generated SQL would be straight inner joins from the base entity class down through the intermediate class to the child class, and only then do left outer joins to any client classes (if any).<br><br>Likewise, for the Include, I had assumed that the fact that the navigation property points to the specific given table, that any generated query wouldn't need to be doing outer joins to other tables elsewhere in the model.<br><br>Is anyone aware of something I may be doing wrong in the setup of my model and/or project that could cause this? Or is there a way that DevForce is meant to be used when dealing with an inheritance hierarchy to avoid this?&nbsp; It's pretty much mandated that the base classes be there, so I'm hoping it's just something simple that I'm doing wrong, and won't have to do anything major to try and work around.<br><br>Any suggestions appreciated.<br><br>]]>
   </description>
   <pubDate>Tue, 31 Jan 2012 22:46:37 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=3246&amp;PID=12593#12593</guid>
  </item> 
 </channel>
</rss>