[Mondrian] Multiple sets in where clause

Julian Hyde jhyde at pentaho.com
Mon May 7 12:33:20 EDT 2012

On May 4, 2012, at 6:37 PM, Benny Chow wrote:

> Analyzer used to use calculated members too and now I recently added the support to apply the same filter via named sets.  I think there are two benefits:
> If you use a named set, then applying the slicer context will take O(n) where n is the number of tuples in the set.  Whereas if you use calculated members, then the complexity would O(x*y) where x is number of members in the first calculated member and y is number in second.  O(n) could be significantly less than O(x*y) if n was a nonempty cross join of x and y.
> The other benefit is that there will more cases where drill though on cells is possible.  This is because Mondrian cannot produce drillthrough sql when the slicer contains calculated members but it can when the slicer is based on a set.
> If you decide to switch between the two, be careful on how the slicer context affects native evaluation in named set expressions.
> See: http://www.luciddb.org/wiki/MondrianQueryEvaluationContext

Microsoft is clear that named sets are evaluated AFTER the slicer but BEFORE other axes, and are evaluated once per query. Suppose a named set is used on say the ROWS axis. Even if that axis has NON EMPTY specified, the named set will include members/tuples that come out empty.

Mondrian tries emulate that behavior while evaluating queries efficiently: in particular, using SQL to evaluate, and evaluating on demand (i.e. named sets that are not needed are not executed). Let us know if behavior departs from the standard.


More information about the Mondrian mailing list