As the facts propagate through the Rete network, another optimization technique is to index fact values. We can then evaluate each test more quickly.
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 ...