Each new minimum/maximum computation requires O(N) comparisons.<br>With frequent changes you may be much better off by maintaining an additional<br>container fact providing a sorted collection and properties for the first and last<br>
element. Of course, monitoring inserts and retracts is an additional burden.<br>-W<br><br><div class="gmail_quote">On 14 May 2011 18:23, jkrupka <span dir="ltr"><<a href="mailto:jkrupka@gmail.com">jkrupka@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Yes, I definitely do have to account for the min/max changing due to facts<br>
updating. How does drools handle the exists constraint internally? Is it<br>
able to take advantage of caching and the rete network or does it have to<br>
look through all the facts each time that rule is being evaluated? If<br>
that's the case, writing my own min/max accumulate might be more efficient<br>
that the approach of using an exists constraint to find the min/max fact.<br>
<font color="#888888"><br>
--<br>
View this message in context: <a href="http://drools.46999.n3.nabble.com/Best-performing-way-to-process-facts-in-a-particular-order-tp2935847p2940505.html" target="_blank">http://drools.46999.n3.nabble.com/Best-performing-way-to-process-facts-in-a-particular-order-tp2935847p2940505.html</a><br>
</font><div><div></div><div class="h5">Sent from the Drools: User forum mailing list archive at Nabble.com.<br>
_______________________________________________<br>
rules-users mailing list<br>
<a href="mailto:rules-users@lists.jboss.org">rules-users@lists.jboss.org</a><br>
<a href="https://lists.jboss.org/mailman/listinfo/rules-users" target="_blank">https://lists.jboss.org/mailman/listinfo/rules-users</a><br>
</div></div></blockquote></div><br>