Same answer: most of the time, it is better to have it as a fact, but sometimes, a from may be better by limiting your search space.

   Again, these things are like SQL. You need to look at the whole domain model as well as the set of your rules. The major performance optimizations are made on a rule-set level, not individual rules. So, if you want the best performance you need to write your individual rules to work better as a set of rules, sharing nodes, reducing partial matches, etc.

   []s
   Edson

2008/11/21 vdelbart <delbart.0466@apside.net>

I have a similar question with global or fact (Foo is never modified)

What's more efficient beetwen :

1. rule "Foo_globals"
   when
       Foo(name != null) from fooGlobals
   then
       ...
end

2. rule "Foo_facts"
   when
       Foo(name != null)
   then
       ...
end

thanks,


regards,

V.

--
View this message in context: http://www.nabble.com/What%27s-more-efficient-too---tp20623413p20623413.html
Sent from the drools - user mailing list archive at Nabble.com.

_______________________________________________
rules-users mailing list
rules-users@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users



--
 Edson Tirelli
 JBoss Drools Core Development
 JBoss, a division of Red Hat @ www.jboss.com