Chapter 2. IBM Cognos Dynamic Cubes architecture 29
2.3.2 Expression cache
A set within the context of MDX contains one or more tuples. A tuple contains a member from
one or more dimensions, where one of those dimensions can be the measures dimension.
Tuples within a set in MDX each contain a member from the same set of dimensions and in
the same order.
The expression cache is used by the MDX engine to cache the result of set expressions that
operate on large sets and output a much smaller set for subsequent reuse, either within the
same query or within subsequent MDX queries processed by the MDX engine. The savings
from the use of cache expression results can be significant, given that in some cases a set
can contain millions of tuples and only output five or ten tuples.
As with the result set cache, the intermediate results that are stored in the expression cache
are security-aware and are flushed when the data cache is refreshed.
Many MDX functions can operate on large sets, which can be characterized as those that
process a large set of tuples as input and, do the following tasks:
򐂰 Perform a simple operation to return a smaller set of tuples (for example, HEAD).
򐂰 Fetch the corresponding values, and return a single value (for example, AGGREGATE).
򐂰 Fetch the corresponding values, and return a smaller set of tuples.
The expression cache feature focuses on those MDX function which process a large input set
of tuples and return a smaller set of tuples. Specifically, the following MDX functions are
supported by the expression cache:
򐂰 TOPCOUNT
򐂰 BOTTOMCOUNT
򐂰 TOPPERCENT
򐂰 BOTTOMPERCENT
򐂰 TOPSUM
򐂰 BOTTOMSUM
򐂰 FILTER
In all, but the following, circumstances are the results of the functions (in the previous list) that
are cached:
򐂰 If any of the inputs to a function contains a calculated member, named set or inline named
set.
򐂰 If the report from which the MDX statement was generated has a prompt variable defined
and it is referenced within the expression.
򐂰 Expressions cached by the engine with an internal,
default value. The use of a default
value is an optimization within the MDX engine that can conflict with the use of the
expression cache.
Each entry in the expression cache has three components that uniquely identifies it:
򐂰 The text of the MDX expression.
򐂰 A security key that identifies a combination of security views.
򐂰 The context in which the expression was evaluated, expressed as a tuple.
Because the expression cache is stored in memory and is so closely associated with the data
cache (see 2.3.5, “Data cache” on page 31), the expression cache is actually stored within
the space allotted to the data cache.

Get IBM Cognos Dynamic Cubes now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.