[rules-users] Hashing in JoinNode and CompositeObjectAdapter

Philipp Herzig pherzig at gmail.com
Fri Mar 8 09:42:36 EST 2013


Hey,

just checked with 5.5.0.Final and same thing just that the index decision
for the JoinNode is postponed to ConstraintType.isIndexableForNode(), where
the nodeType equals UNKNOWN and thus no indexing is allowed.

Thanks,

Philipp

2013/3/8 Philipp Herzig <pherzig at gmail.com>

> Dear developers,
>
> I have a question regarding the current implementation within reteoo.
> In both cases, the JoinNode and CompositeObjectAdapter is doing a linear
> search for Joins and "Splits" respectively.
>
>
>
> For the BetaNodes the decision using lists or maps is done in
> SingleBetaContraints() (line 82)
>
> this.indexed = depth >= 1 && DefaultBetaConstraints.isIndexable(
> constraint );
>
> However, the MVELContraint (constraint) always returns false for an
> equijoin predicate (always the MVELContraint constructor without index flag
> is called). Consequently, createBetaMemory() creates lists rather than
> maps. These are finally joined in assertLeftTuple and assertObject of the
> JoinNode with complexity 2n-1.
> (Note: Of course, IndexLeftBetaMemoryOption.YES
> and IndexRightBetaMemoryOption.YES are set but ignored according to the
> SingleBetaContraints' constructor).
>
>
> Relatively similar the CompositeObjectAdapter:
>
> While propagating objects (CompositeObjectAdapter.propagateAssertObject)
> the method asks if a fieldIndex is hashed which always returns false.
> However, I cannot find any possibility to set this flag to true.
> Interestingly the fields are added to a collection called
> hashedFieldIndexes in FieldIndex.registerFieldIndex. Moreover the code for
> dispatching to the right sink via hashcode is there, but is not reachable
> anyway.
>
> Are there any design related reasons for not supporting this or am I
> missing something? If not, I would love to open a FR for that. If someone
> helps me in setting up the mvn stuff I could do that myself.
>
> (Version 5.4.0.Final)
>
> Thanks,
>
> Philipp
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20130308/f99d8730/attachment.html 


More information about the rules-users mailing list