[rules-users] Poor performance from a simple join

David Martin david.martin at mercedsystems.com
Mon Dec 19 11:46:35 EST 2011


Hi Mauracio!

THANK YOU!

I tried the following and things just lit up!


rule "Binning for Attribute: Device_type_desc"

  when

    $call : BINNING_INPUT( device_type_desc != null )

    $device_typeLookup : LU_DEVICE_TYPE( $call.device_type == device_type )

  then

    $call.setDevice_type_desc($device_typeLookup.getDevice_type_desc());

end

Why does the "guard" on the BINNING_INPUT result in such a speedup?  Is the fact being processed by the same rule over and over again?  Do I need to wrap my $call.setDevice_type_desc(...) call in a modify block?

Dave

On 12/19/11 8:31 AM, "Mauricio Salatino" <salaboy at gmail.com<mailto:salaboy at gmail.com>> wrote:

If you can write a more restrictive rules, you will be able to not
generate that 10kx10k matrix.
If you activate the log you will see 10kx10k activations that I'm sure
that it's causing the delay.
Can you write a more restrictive rule?

I'm not sure to understand this join -> $call.device_type == device_type
device_type is a constant? or is something that you get from another Pattern?

Cheers

2011/12/19 David Martin <david.martin at mercedsystems.com<mailto:david.martin at mercedsystems.com>>:
Folks:

My co-workers and I have been using Drools to great success, but we ran
smack into a performance brick wall recently.

In the example below, both BINNING_INPUT and LU_DEVICE_TYPE have large
numbers of associated facts in working memory (BINNING_INPUT has more than 8
million facts in working memory, LU_DEVICE_TYPE about 10k.)

LU_DEVICE_TYPE models a lookup table.

rule "Binning for Attribute: Device_type_desc"
  when
    $call :
      BINNING_INPUT()
    $device_typeLookup :
      LU_DEVICE_TYPE(
        $call.device_type == device_type
      )

  then
    $call.setDevice_type_desc($device_typeLookup.getDevice_type_desc());
end

It's a simple enough rule: join on the device_type field.  Unfortunately,
this rule and a few others like it are taking FOREVER to insert.  Even when
I cut the number of BINNING_INPUT facts in working memory down from 8M to
10k.

This feels like a basic Drools question.  But I can't seem to find any help
from google.

Please advise!

Thanks in advance,

Dave Martin


_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org<mailto:rules-users at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users




--
 - CTO @ http://www.plugtree.com
 - MyJourney @ http://salaboy.wordpress.com
 - Co-Founder @ http://www.jugargentina.org
 - Co-Founder @ http://www.jbug.com.ar

 - Salatino "Salaboy" Mauricio -

_______________________________________________
rules-users mailing list
rules-users at lists.jboss.org<mailto:rules-users at lists.jboss.org>
https://lists.jboss.org/mailman/listinfo/rules-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/rules-users/attachments/20111219/fc1688be/attachment.html 


More information about the rules-users mailing list