Improve performance of Aggregate subtotals
Description
Environment
Test Cases
Steps to Reproduce
Workaround
Attachments
has Pentaho private
Activity
Details
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>
Performance of aggregate totals with filters on the report can be significantly improved by lowering the solve order of the compound slicer member so that it is evaluated after the aggregate total calculated member. The aggregate subtotal member uses a solve order of -100. (The design decision for -100 was so that schema defined calculated measures that default to a solve order of 0 can work with aggregate totals.) The current solve order of the compound slicer member is 0 but we should make this configurable and default to -99999.
Here's a sample report with 62K rows with 4K totals. Solve order -99999 runs 45% faster than solve order 0 (Compare red and green rows). The number of cell requests and calls to the Aggregate function are significantly reduced:
Report:
The reason for such a big improvement has to do with evaluating the AGGREGATE calculated member before the compound slicer calculated member and being able to leverage a better expression cache that is implicitly used by the compound slicer.
Note: For comparison, I ran the same report with SUM totals and SUM is still faster than AGG. I also compare with 9.1 and the performance is the same as 9.2 when the solve order is 0.