-
1. Re: Understanding Indexes in MRL ?
Kaushik KM Jan 23, 2019 8:30 PM (in response to Kaushik KM)Just bringing it up in the stack
-
2. Re: Understanding Indexes in MRL ?
Brian Morris Jan 25, 2019 12:39 PM (in response to Kaushik KM)The first bolded line is defining an index on the base EVENT class, creating it as a hashed index (which is tuned to be a perfomance enhancement when we hit a rule that needs to find a match or several matches based on the ECF) and declaring that the slot called "clear_slot" is the one which it will index.
The new rule is just invoking the index in order to locate relevent events. So it will find all events that are indexed by clear_slot and assign that to $OLD and further qualify those matches by using the where criteria, so the classes have to match and the old event can't be closed.
-
3. Re: Understanding Indexes in MRL ?
Kaushik KM Jan 26, 2019 8:20 PM (in response to Brian Morris)1 of 1 people found this helpfulHi Brian Morris,
Thank you for responding & being very active here.
i have been going through other examples and tried to put this way.. let me know if there is anything wrong.
defining an index --> to say it in layman's language, and visualize it, does it mean like to say "keep a stack of events of class or subclass of EVENT ready in table named "clear_due_to_OK_idx" to be evaluated against any rule looking at the only slot "clear_slot" without bothering about the order of evaluation(hashed) ?
coming to :
USING ALL {} block,
looking at the 1st line inside the block:
>> using the index table which we created above, submit the value of slot clear_slot of the current event being evaluated against ALL the events in the table, having the same value as that of current event and point ALL those previous events with variable "$OLD" and perform the action whatever present in the triggers block ?
what will happen if we dont use the word "ALL"?
does it find only one event which is matching the clear_slot value and perform action on only one event ?
Thank you for your time.
Kaushik KM
-
4. Re: Understanding Indexes in MRL ?
Brian Morris Jan 28, 2019 7:36 AM (in response to Kaushik KM)I think you have a good understanding of it now. Defining the index is correct, the ony thing I would add is that "clear_due_to_OK" is evaluated only against a rule that calls it, not necessarily any or every rule. So if we look at the new rule in your example, its invoking this index by name.
So yes, in this case, as it is presently written, for each match it finds it will do whatever has been defined in the triggers block.
If you don't use ALL a few things can occur, but they're logically kind of similar.
- Nothing matches the ECF or the index, so the rule ends
- Only one event matches, so only that one event is used
- More than one match exists, but only the first will be used
I hope this helps.
-
5. Re: Understanding Indexes in MRL ?
Kaushik KM Jan 28, 2019 2:22 PM (in response to Brian Morris)Thank you Brian Morris I had confusion for the last point, which is cleared now.
- More than one match exists, but only the first will be used and after that rule ends - if the keyword 'ALL' is not used.