OLAPCubeCache
When you work with OLAP, cubes can theoretically hold huge amounts of values while they usually hold only a fraction of possible values. In most cases you can use data area functions to find these values efficiently. But as data areas provide the values in undefined order, it can be impossible to process them in some cases. For these cases, it is required to iterate through the dimension elements to ensure that the values are processed in a certain order. For larger structures this approach can be impossible, because of the huge amount of data.
To manage these cases, the
OLAPCubeCache
data type was introduced, which combines
the two approaches above. A cube cache uses a data area to find all values in
the specified range. But it is not processing the values nor does it remember
all of them, because they can still be too many to keep them in memory. The
cube cache remembers for the dimensions that you name to cache, whether a value
is found for an element or for a combination of elements.
With this information, you can use nested loops to iterate through the values. By creating the cube cache before, it can be immediately checked in every loop for a dimension, whether a value is found for an element and all combinations with other elements . If not, all nested loops can immediately be skipped.
OLAPConnection con = OLAPCreateConnection( "server", "user", "password" ); OLAPCubeCache cache = OLAPCreateCubeCache( con, "cube", "dimension1", "dimension2" );