Filtering trees for selectively notifying subscribers of events are
provided, and are constructed with OR nodes to substantially reduce their
size. The filtering trees have nodes representing event variables that
ultimately branch to leaf nodes thereunder, and the leaf nodes identify
which of a set of queries are satisfied by an actual event. A mechanism
recursively merges nodes of trees into a single tree, and uses OR nodes
when nodes cannot be combined, to essentially add a parallel path in the
resulting tree to traverse. Nodes that can be combined are those that
represent the same event variable, and may have data points that are
merged into a combined node. Threshold gains in efficiency may be
evaluated to determine whether the original trees should be kept instead
of the resulting tree.