O'Reilly logo

Drools JBoss Rules 5.X Developer's Guide by Michal Bali

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.

The AlphaNode indexing

When a fact meets constraints specified by a node, it is propagated to all its descending child nodes. This usually means iterating over all child nodes and propagating the fact. This takes some time, especially if there are many child nodes. Luckily, we can index some AlphaNode node. The AlphaNode node with the equals constraints (literal constraints). 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 (test will succeed). This means that ...

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