<?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 : CompositePredicateDescription times out and gets progressively slower when combining more than 15 or so PredicateDescriptions</title>
  <link>http://www.ideablade.com/forum/</link>
  <description>This is an XML content feed of; DevForce Community Forum : DevForce 2010 : CompositePredicateDescription times out and gets progressively slower when combining more than 15 or so PredicateDescriptions</description>
  <pubDate>Mon, 13 Apr 2026 12:24:07 -700</pubDate>
  <lastBuildDate>Tue, 09 Aug 2011 17:10:30 -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=2852</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>CompositePredicateDescription times out and gets progressively slower when combining more than 15 or so PredicateDescriptions : We&amp;#039;ve upgraded and retested...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2852&amp;PID=11383#11383</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=543" rel="nofollow">pk55</a><br /><strong>Subject:</strong> 2852<br /><strong>Posted:</strong> 09-Aug-2011 at 5:10pm<br /><br />We've upgraded and retested and this is fixed.&nbsp; Thanks for getting that in.]]>
   </description>
   <pubDate>Tue, 09 Aug 2011 17:10:30 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2852&amp;PID=11383#11383</guid>
  </item> 
  <item>
   <title>CompositePredicateDescription times out and gets progressively slower when combining more than 15 or so PredicateDescriptions : PK55,  In testing this, I found...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2852&amp;PID=11360#11360</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1097" rel="nofollow">robertg</a><br /><strong>Subject:</strong> 2852<br /><strong>Posted:</strong> 04-Aug-2011 at 4:41pm<br /><br />PK55,<DIV>&nbsp;</DIV><DIV>In testing this, I found that there was a bug after all. One of our developers was able to rush a fix in to the new release, which came out yesterday. When you can, I recommend upgrading to the new version of DF (which requires you to regenerate your model, as usual) and take a look. The problem should be resolved.</DIV><DIV>&nbsp;</DIV><DIV>Yours,</DIV><DIV>Robert</DIV>]]>
   </description>
   <pubDate>Thu, 04 Aug 2011 16:41:42 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2852&amp;PID=11360#11360</guid>
  </item> 
  <item>
   <title>CompositePredicateDescription times out and gets progressively slower when combining more than 15 or so PredicateDescriptions : I doubt it&amp;#039;s an EF thing...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2852&amp;PID=11328#11328</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=543" rel="nofollow">pk55</a><br /><strong>Subject:</strong> 2852<br /><strong>Posted:</strong> 28-Jul-2011 at 9:38pm<br /><br />I doubt it's an EF thing since I can build 400 of them using&nbsp;the native EF predicate builder&nbsp;in under one second in LinqPad (this is against the linqpad demo db model):<DIV>&nbsp;</DIV><DIV><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><P>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> predicate = PredicateBuilder.False&lt;Product&gt;();</P></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><P>for</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> (</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>int</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> i = </FONT></FONT><FONT color=#c81efa size=2 face=C&#111;nsolas><FONT color=#c81efa size=2 face=C&#111;nsolas><FONT color=#c81efa size=2 face=C&#111;nsolas>0</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>; i &lt;= </FONT></FONT><FONT color=#c81efa size=2 face=C&#111;nsolas><FONT color=#c81efa size=2 face=C&#111;nsolas><FONT color=#c81efa size=2 face=C&#111;nsolas>400</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>; i++)</P><P>{</P><P></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>var</FONT></FONT></FONT><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas> item = i;</P><P>predicate = predicate.Or (p =&gt; p.ID == item);</P><P>}</P></FONT></FONT><P><FONT size=2 face=C&#111;nsolas><FONT size=2 face=C&#111;nsolas>Products.Where (predicate).Dump ();</P></FONT></FONT></DIV>]]>
   </description>
   <pubDate>Thu, 28 Jul 2011 21:38:31 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2852&amp;PID=11328#11328</guid>
  </item> 
  <item>
   <title>CompositePredicateDescription times out and gets progressively slower when combining more than 15 or so PredicateDescriptions : I&amp;#039;ve tested this, and it...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2852&amp;PID=11327#11327</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=1097" rel="nofollow">robertg</a><br /><strong>Subject:</strong> 2852<br /><strong>Posted:</strong> 28-Jul-2011 at 4:25pm<br /><br /><P>I've tested this, and it does seem that adding additional predicates to the CompositePredicateDescription takes an increasingly long time once you've gone past a certain number of predicates. I'm not sure if this is a limitation of DevForce or EntityFramework, so I'll open a defect ticket for us to investigate it.</P><DIV>You might want to try using PredicateBuilder instead. I did a little bit of initial testing with it, and it looks like creating a chain of 20 predicates linked with OR does not take significantly longer than just 5 or so. Information on this is available in the DRC at <a href="http://drc.ideablade.com/xwiki/bin/view/&#068;ocumentati&#111;n/predicatebuilder-methods" target="_blank">http://drc.ideablade.com/xwiki/bin/view/Documentation/predicatebuilder-methods</A></DIV>]]>
   </description>
   <pubDate>Thu, 28 Jul 2011 16:25:52 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2852&amp;PID=11327#11327</guid>
  </item> 
  <item>
   <title>CompositePredicateDescription times out and gets progressively slower when combining more than 15 or so PredicateDescriptions : Tyring to OR more than 10-12 single...</title>
   <link>http://www.ideablade.com/forum/forum_posts.asp?TID=2852&amp;PID=11316#11316</link>
   <description>
    <![CDATA[<strong>Author:</strong> <a href="http://www.ideablade.com/forum/member_profile.asp?PF=543" rel="nofollow">pk55</a><br /><strong>Subject:</strong> 2852<br /><strong>Posted:</strong> 27-Jul-2011 at 10:07pm<br /><br /><P>Tyring to OR more than 10-12 single predicate descriptions for the same property one a time into a composite predicate description causes timeouts on the entity server and each time you OR a new predicate, it gets progressively slower, getting&nbsp;really bad as you get over 15 ORs.&nbsp; The last call we see (before hitting the timeout) is to IdeaBlade.Linq.CompositePredicateDescription.InstanceType.get() line 85.</P><DIV>I've been able to use LinqPad against our generic EF datamodels with the standard EF PredicateBuilder to do the same thing and it can handle over 400 predicates ORed together (LinqPad blows up if I try 500) so this can't be an EF limitation.</DIV><P>The property in this case was an INT field (but this probably happens for any type) and each predicate was just using the filter for equality.&nbsp; The code that creates these is very dynamic but essentially, after first creating a single predicate description, if it finds another predicate for the column, it builds a new predicate description and combines the first 2&nbsp;single predicates into a composite.&nbsp; Subsequent predicates on that same property uses the composite to combine it with an OR on each new predicate.&nbsp; </P><DIV>In this particular case, I can't really use an InList filter operator without massive code restructuring to try and gather up all the related filter requests for a particular column as our filtering logic allows for some wildly dynamic conditions.&nbsp; Besides,&nbsp;it&nbsp;seems that either DevForce or EF (can't tell who)&nbsp;is smart enough to convert multiple ORs into a single WHERE IN clause when it generates the SQL so there isn't any performance issue at the SQL server level.</DIV><DIV>&nbsp;</DIV><DIV>I've created an example you can use to duplicate&nbsp;this against NorthwindIB. Try just setting a breakpoint on "c1 = c1.Or(p);" and watch how each loop gets slower until it times out:</DIV><P><table width="99%"><tr><td><pre class="BBcode"><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // test for &gt; 20 predicates ORed together<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PredicateDescription p1 = null;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; CompositePredicateDescription c1 = null;</P><P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for (int i = 0; i &lt;= 20; i++)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p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</P><DIV></pre></td></tr></table></DIV><DIV><BR>&nbsp;</DIV>]]>
   </description>
   <pubDate>Wed, 27 Jul 2011 22:07:15 -700</pubDate>
   <guid isPermaLink="true">http://www.ideablade.com/forum/forum_posts.asp?TID=2852&amp;PID=11316#11316</guid>
  </item> 
 </channel>
</rss>