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.