Each new minimum/maximum computation requires O(N) comparisons.
With frequent changes you may be much better off by maintaining an additional
container fact providing a sorted collection and properties for the first and last
element. Of course, monitoring inserts and retracts is an additional burden.
-W

On 14 May 2011 18:23, jkrupka <jkrupka@gmail.com> wrote:
Yes, I definitely do have to account for the min/max changing due to facts
updating.  How does drools handle the exists constraint internally?  Is it
able to take advantage of caching and the rete network or does it have to
look through all the facts each time that rule is being evaluated?  If
that's the case, writing my own min/max accumulate might be more efficient
that the approach of using an exists constraint to find the min/max fact.

--
View this message in context: http://drools.46999.n3.nabble.com/Best-performing-way-to-process-facts-in-a-particular-order-tp2935847p2940505.html
Sent from the Drools: User forum mailing list archive at Nabble.com.
_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users