Forum Stats

  • 3,853,867 Users
  • 2,264,288 Discussions
  • 7,905,491 Comments

Discussions

Optimizing OPA Rulebase

Snehal Tendulkar
Snehal Tendulkar Member Posts: 39 Blue Ribbon

Couple of questions with regards to optimizing rules and improving performance in OPA.

Question 1:

  • Which of the below is the effective way to write a rule in OPA in terms of performance as well as maintenance?
  • Writing rule as Option #1 reduces the rule count in the rulebase. Does this help with optimizing the rules?

Option #1:

pastedImage_44.png

Option #2:

pastedImage_7.pngpastedImage_8.png

Question 2:

Does the XML Tree Structure (depth of the tree OR number of child nodes) affect the performance of the OPA rulebase?

Option #1:

pastedImage_39.png

Option 2:

pastedImage_40.png

Thanks,

Snehal

Tagged:
Davin Fifield-Oracle

Best Answer

  • Brad Tuckett-Oracle
    Brad Tuckett-Oracle Moderator Posts: 643 Employee
    edited Sep 12, 2018 5:04AM Answer ✓

    1. The performance is the same - C and D proves B, and B proves A.  The maintenance question is subjective - what is the source material this is modelling and which option is the closest match to that material?

    2. So far as logic connectors like AND and OR are concerned, depth has no affect on performance - once the dependant attributes are known, the logic is evaluated.

    Brad Tuckett, Intelligent Advisor team

    Davin Fifield-OracleSnehal Tendulkar

Answers

  • Brad Tuckett-Oracle
    Brad Tuckett-Oracle Moderator Posts: 643 Employee
    edited Sep 12, 2018 5:04AM Answer ✓

    1. The performance is the same - C and D proves B, and B proves A.  The maintenance question is subjective - what is the source material this is modelling and which option is the closest match to that material?

    2. So far as logic connectors like AND and OR are concerned, depth has no affect on performance - once the dependant attributes are known, the logic is evaluated.

    Brad Tuckett, Intelligent Advisor team

    Davin Fifield-OracleSnehal Tendulkar
  • Aaron Houston - Houston Technologies LLC
    Aaron Houston - Houston Technologies LLC Member Posts: 86 Red Ribbon
    edited Sep 19, 2018 11:38PM

    Snehal,

    Performance isn't significantly impacted by convenience attributes . e.g., example 2. The largest performance issues you will likely have with a rulebase, if it's the rulebase at all, will be with relationships. Specifically, generation of relationships like inferred relationships, and when inferred entities generate relationships. The latter, more so than the former due to the fact that whatever entity instance you are generating, you're getting that many relationships and inferred relationships created during the instance generation. Thus, if you have 10 relationships to an inferred entity instance, and you generate 15 instances, you're making OPA generate 150 relationships and the number of attributes * 15 as well.

    Regards,

    Aaron Houston

    Davin Fifield-OracleSnehal Tendulkar
This discussion has been closed.