]
Mario Fusco resolved DROOLS-4633.
---------------------------------
Resolution: Done
Fixed by
Optimize self-join patterns forall statement
--------------------------------------------
Key: DROOLS-4633
URL:
https://issues.jboss.org/browse/DROOLS-4633
Project: Drools
Issue Type: Enhancement
Reporter: Mario Fusco
Assignee: Mario Fusco
Priority: Major
At the moment a forall statement with a self join like
{code}
forall( $t : Type( constraints1 ) Type( this == $t, constraints2 ) )
{code}
is implemented with 2 not nodes and a join. It would be much faster to rewrite it as
{code}
not( Type( constraints1, !constraints2 ) )
{code}
and then evaluate it with one single not node.