Apama Documentation : Developing Apama Applications : Developing Apama Applications in EPL : Defining Event Listeners : Improving performance by ignoring some fields in matching events
Improving performance by ignoring some fields in matching events
In applications where a particular field of an event type will never participate in the match criteria for that event type, the performance of Apama can be improved (at times drastically) by marking that field as a wildcard field in the event type definition.
For example, consider a version of the StockTick event type that has four fields: name, volume, price, and source. If in our application volume and source are never going to be used for matching on within event templates, that is, they will always be marked as * (wildcard), they could be tagged so explicitly in the event type:
event StockTick {
   string name;
   wildcard float volume;
   float price;
   wildcard string source;
}
The wildcard keyword tells Apama not to include this field in its internal indexing, as it will never be required in a match operation. This not only saves memory, but can significantly improve performance, particularly when there are many such fields which never occur in match conditions. Note that removing fields from an event type altogether is even more efficient than using wildcard, but this is not always possible. For example, the field might not be relevant in match conditions but it might be input to calculations within an action block, or it might need to be included in an event specified in a send...to statement.
When a field has been declared as a wildcard then any subsequent attempt to define a match condition using that field will result in a parser error, and the offending monitor will not be injected.
Therefore, given the above event type definition, the following will result in a parser error:
action someAction() {
   on StockTick("ACME", >125.0,*,"NASDAQ") doSomething();
}
while the following is correct:
action someAction() {
   on StockTick("ACME", *, 50.0, *) doSomething();
}
Copyright © 2013-2017 Software AG, Darmstadt, Germany. (Innovation Release)

Product LogoContact Support   |   Community   |   Feedback