[rules-users] Order of columns and of constraints

Anstis, Michael (M.) manstis1 at ford.com
Thu May 31 05:49:29 EDT 2007


Hi Dirk,

I understand (but could be wrong!) that the ordering of patterns does
influence the performance of the rules. I assume that the RETE network
is created from top to bottom as the rules are parsed. Therefore more
restrictive constraints at the start of a rule will be parsed first and
hence be nearer the root of the RETE network consequentially optimising
the identification of activations. 

I suspect the "Rules Team" will give a more scientific explanation ;-)

With kind regards,

Mike

-----Original Message-----
From: rules-users-bounces at lists.jboss.org
[mailto:rules-users-bounces at lists.jboss.org] On Behalf Of Dirk Bergstrom
Sent: 31 May 2007 03:27
To: Rules Users List
Subject: [rules-users] Order of columns and of constraints

Does the order of columns in the rule definition, and the order of
constraints
within a column matter?

For a given rule, I know which test is most likely to fail, and
(probably) which
one is most "expensive" in terms of processing time (eg. 'someCollection
contains $var' is more expensive than 'field == "literal"').  I'd like
to put
the fail-fast tests up front, and the expensive ones last.

Does that actually work in Drools?  Can I "optimize" my rules by
juggling the
order of the columns and constraints?

-- 
Dirk Bergstrom               dirk at juniper.net
_____________________________________________
Juniper Networks Inc.,          Computer Geek
Tel: 408.745.3182           Fax: 408.745.8905
_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org
https://lists.jboss.org/mailman/listinfo/rules-users




More information about the rules-users mailing list