O'Reilly logo

Drools JBoss Rules 5.0 Developer's Guide by Michal Bali, Bogdan Brinzarea

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Node indexing

As the facts propagate through the Rete network, another optimization technique is to index fact values. We can then evaluate each test more quickly.

AlphaNode indexing

When a fact meets the constraints specified by a node, it is propagated to all of its descending child nodes. This usually means iterating over all of the child nodes and propagating the fact. This takes some time, especially if there are many child nodes. Luckily, we can index AlphaNodeAlphaNode with 'equals' constraints (literal constraints) to be more specific. By default, Drools creates an index (a hash table) if we are testing a property for more than three different values. The object is propagated only to nodes, where it makes sense (the test will succeed). ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required