[rules-users] Drools Timers

Federico Bertola federico.bertola88 at gmail.com
Thu Sep 25 11:40:24 EDT 2014


Hi all,
I've a big rule file that contains *many* rules like this:

rule "rule1"
when
     $obj1: OBJ(a==false, b=="C")
     $obj2: OBJ(b=="B", a==false)
then
  <...>
end

Inspecting the RETE tree I've noticed that the first layer contains two 
alpha node, one for "a==false" and one for "b=="B", than the second 
layer contains the duplicate alpha node for "a==false" and one for 
"b==C". This is somewhat (at least for me) counter intuitive, because I 
thought the algorithm would  be a little bit smarter trying to order the 
clauses from the most restrictive to the least.
I there a particular reason why this optimization it's not implemented? 
It's difficult or semantically incorrect?

I've noticed this because compiling this file with many rules which have 
no particular order on clauses led to a tree with a extremely large 
first level. This obviously was detrimental but a simple ordering of the 
clauses fixed it.
This became a problem only when we upgraded form 5.0.1 to 6.1.0-Final. 
Why I didn't noticed any performance problem with the previous version 
of Drools?

Thanks in advance.

Federico.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20140925/80a76a98/attachment.html 


More information about the rules-users mailing list