Showing posts with label NONEMPTYTUPLE. Show all posts
Showing posts with label NONEMPTYTUPLE. Show all posts

Monday, September 28, 2015

Measuring NONEMPTYMEMBER/TUPLE in MDX Part 2

Welcome to MDX Monday. I'll pick up where I left off in Measuring NONEMPTYMEMBER/TUPLE in MDX Part 1 last Monday. I ended that part with the desire to test out the same non-empty directives within member formulas. In this test I will use the calculation portion of the query in Part 1 and place it into a member formula. Then I'll try using NONEMPTYTUPLE and NONEMPTYMEMBER in order to see if there is a difference in performance in the ASOsamp database.

The Member Formula

NONEMPTYTUPLE ([Units], [MTD])
  Sum(
       {
        ClosingPeriod(Time.Generations(5), Time.CurrentMember),
        Time.CurrentMember.Lag(1),
        Time.CurrentMember.Lag(2)
        }, 
        Units
   )

The Tests

In this test I will duplicate the data pull that I used in Part 1 by zooming to the bottom on the Store Manager and Stores dimensions with the month of March selected. These are the four tests. Each retrieval will be identical.

1. Run the example as is, including the NONEMPTYTUPLE statement.
2. Remove the NONEMPTYTUPLE statement.
3. Change the NONEMPTYTUPLE ([Units],[MTD]) to NONEMPTYMEMBER [Units]
4. Change the NONEMPTYTUPLE ([Units],[MTD]) to NONEMPTYMEMBER [MTD]

The query time results are below. Each returned the exact same set.

The Results

1. 0.39s
2. 9.72s
3. 0.29s
4. 9.7s


Note: I got the same warning in the log for the 3 Month Units member as I got in Part 1 during the MDX query execution for Test 4. 

Warning: Non empty member directive [MTD] for member [3 Month Units] will be ignored since it is from a different dimension.

Analysis and Conclusions and Another Test

These results were almost exactly in line with the results in Part 1. They were all +.07 or +.08 the respective test in Part 1, the difference probably attributed to overhead/network latency associated with Smart View. The non-empty directive can help ASO member formulas. I wondered if it had something to do with the fact that an attribute dimension (Store Manager) was used in the query. So I removed that and reran the test.

1. 0.34s
2. 0.39s
3. 0.24s
4. 0.38s

It looks like the attribute dimension was hurting the performance when not using the non-empty directive. The difference in performance without the attribute dimension is very minor but there still is a difference albeit very small. The bottom line is that you should probably at least try to use the NONEMPTYMEMBER and NONEMPTYTUPLE when the application log suggests it.

Monday, September 21, 2015

Measuring NONEMPTYMEMBER/TUPLE in MDX Part 1

Welcome to MDX Monday. There is a page in the Essbase Tech Ref entitled "MDX Optimization Properties". It describes the use of NONEMTPYMEMBER and NONEMPTYTUPLE in MDX. Supposedly these keywords will speed up MDX queries and member formulas (in ASO) by eliminating the inclusion of missing sets from the formula execution. There is anecdotal evidence that this does speed things up. It seems like it's very difficult to pin down when it does help things. I'm on a mission to figure this out so if you've got examples of it helping, please leave a comment letting me know about it.

I thought I'd start out with the ASOsamp example given in the Tech Ref. I tested out four scenarios.

The Tests

1. Run the example as is, including the NONEMPTYTUPLE statement.
2. Remove the NONEMPTYTUPLE statement.
3. Change the NONEMPTYTUPLE ([Units],[MTD]) to NONEMPTYMEMBER [Units]
4. Change the NONEMPTYTUPLE ([Units],[MTD]) to NONEMPTYMEMBER [MTD]

The query time results are below. Each returned the exact same set.

The Results

1. 0.32s
2. 9.64s
3. 0.21s
4. 9.63s

I got the following warning message for the 4th test. This makes sense because the Sum() function is using [Units] as the value it is summing up.
Warning: Non empty member directive [MTD] for member [3 Month Units] will be ignored since it is from a different dimension.

So the "non-empty directive", as the Essbase application log puts it, does improve performance on this relatively complex MDX statement. It is interesting that NONEMPTYMEMBER is slightly faster (I tested it many times to make sure it wasn't an anomaly) than NONEMPTYTUPLE. I think next I'll try testing this same example in a member formula and see what the differences are.

Question of the day: What was the first version of Essbase you used?