Improve performance of nested Top 10 queries

Description

Due to the work in , I am seeing places in Analyzer's MDX generation that could result in orders of magnitude improvement with Top 10 filters.

In particular, for nested Top 10 queries such as Top 10 Customers in each Income, we can optimize the use of the Rank MDX function to significantly reduce the number of scans it makes on the pre-Top 10 cross join set. This improvement will net more than 10x reduction in query time when the pre-Top 10 cross join set is large or there are many levels after the Top 10 level.

Here's a sample report that has a Top 10 on Customer Name which is nested under Yearly Income:

Here's the performance improvement:

With SUM totals, this report run 99% faster on 9.2 than 9.1:

Environment

None

Test Cases

None

Steps to Reproduce

None

Workaround

None

Attachments

3

Activity

Show:
Fixed

Details

Assignee

Reporter

Edit Screen Preamble

<div class="notify info" style="margin-bottom: 10px;">
If you are a Pentaho customer, please use the <a href="http://support.pentaho.com">Customer Support portal</a> to log issues.
<p />
This system is used for logging bugs and enhancement requests only. Please use our <a href="https://community.pentaho.com">community at https://community.pentaho.com</a> if you have questions, configuration issues, or have an issue with a marketplace plugin as Pentaho does not support marketplace plugins unless written by Pentaho.
<p />
Lastly, when creating a bug, please provide as much detail as possible. To prevent unnecessary delays in reviewing your issue, please attach complete server logs, SQL/MDX logs where applicable, schemas, etc. Also, screen-shots and screen-cams are especially helpful in demonstrating the issue.
<p />
Thank-you so much,<br />
The Pentaho Team
</div>

Notice

<div class="notify info" style="margin-bottom: 10px;">
When an issue is open, the "Fix Version/s" field conveys a target, not necessarily a commitment. When an issue is closed, the "Fix Version/s" field conveys the version that the issue was fixed in.
</div>

Sprint Team

Story Points

Fix versions

Affects versions

Priority

Created January 11, 2021 at 5:32 PM
Updated March 2, 2023 at 11:54 PM
Resolved August 12, 2021 at 1:23 PM