Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MONDRIAN-2426] Performance with subtotals/totals is significantly wo… #1106

Merged
merged 1 commit into from
Mar 4, 2019

Conversation

bennychow
Copy link
Contributor

…rse than without. Add function to be used by Analyzer.

@bennychow
Copy link
Contributor Author

@wingman-pentaho
Copy link
Collaborator

Build Completed

🔥 This pull request has some issues. It would be preferable to fix them in order for it to be just perfect. See below for more details. Some links are also available below for further assistance in addressing those issues.

Build Commands

mvn -B -f 'pom.xml' -pl 'mondrian' -P '!assemblies' -DrunITs=true -Dsurefire.runOrder=alphabetical -Dfailsafe.runOrder=alphabetical -Daudit -amd clean install

Cleanup Commands

mvn -B -f 'pom.xml' -pl 'mondrian' -P '!assemblies' -amd build-helper:remove-project-artifact

Changed files

  mondrian/src/it/java/mondrian/olap/fun/CachedExistsTest.java
  mondrian/src/main/java/mondrian/olap/fun/BuiltinFunTable.java
  mondrian/src/main/java/mondrian/olap/fun/extra/CachedExistsFunDef.java

Integration Test Coverage

These statistics help you identify how your changes have affected the coverage of the following files. If a file is not in this list, then its coverage was not affected by your changes. To get some help interpreting these metrics, please refer to Jacoco's documentation.

⚠️ Coverage Changes (click to expand)
🆕 mondrian.olap.fun.extra.CachedExistsFunDef
  • Branch Coverage: 0%
  • Complexity Coverage: 20%
  • Instruction Coverage: 7.1%
  • Line Coverage: 12%
  • Method Coverage: 33.3%
mondrian.rolap.BatchLoader
  • Branch Change: -1% 🔻
  • Complexity Change: -1.6% 🔻
  • Instruction Change: -1.3% 🔻
  • Line Change: -0.9% 🔻
mondrian.rolap.FastBatchingCellReader
  • Branch Change: -1.9% 🔻
  • Complexity Change: -3.1% 🔻
  • Instruction Change: -0.4% 🔻
  • Line Change: -1.1% 🔻

@bennychow
Copy link
Contributor Author

@mkambol @lucboudreau @kurtwalker Could someone help review this custom function I added for improving Analyzer performance? Thanks

@bennychow
Copy link
Contributor Author

Here are the Analyzer changes that use this new function:

https://github.com/pentaho/pentaho-analyzer/pull/1935

@lucboudreau
Copy link
Member

I'm not sure the keys generated have enough information to be unique. A virtual cube using the same level name would require different subtotals but hit the same cache key, no?

@bennychow
Copy link
Contributor Author

@lucboudreau I don't think whether the cube is virtual or not would matter. The generated keys (i.e. tuples of member unique names) are used to look up items from the input non-dynamic set. Whether this is used in a virtual cube context or not should not matter. There is no nonempty logic in the function.

@lucboudreau
Copy link
Member

@bennychow I think it may cause issues if a report is ran on the base cube first, then on a virtual cube with the same D/H/L names afterwards. A test would prove me wrong.

@bennychow
Copy link
Contributor Author

@lucboudreau This cache is query specific. That’s why I put it into the Query object. Two different MDX statements would not share the same cache. BTW, how long does the Query object live around for? It is freed for garbage collection right after the query is done?

@lucboudreau
Copy link
Member

@bennychow We don't force garbage collection. It'll get picked up whenever the JVM needs more space.

@lucboudreau
Copy link
Member

My only last question is: should this be in the core function def for Exists? Is there a reason we wouldn't want this as the default behavior?

@bennychow
Copy link
Contributor Author

CachedExists assumes the first set is non-dynamic and requires the caller to name this set and pass that same name in on subsequent calls to benefit from the cache. There’s also overhead for building this cache which may be unnecessary if Exists is only called once.

I think this CachedExists is very specific to Analyzer and hard to generalize to Exists.

@lucboudreau
Copy link
Member

I can't remember if we have more documentation to update. I'm on my phone and can't check, and I'll take a look tomorrow, but there may be a MDX document to keep updated in the git project somewhere.

And yeah. The first set turning static is a blocker for the general case Exists.

@lucboudreau
Copy link
Member

Hey @bennychow sorry about the delay. The MDX functions need to be documented here too.

https://github.com/pentaho/mondrian/blob/master/mondrian/src/site/resources/doc/mdx.html

…rse than without. Add function to be used by Analyzer.
@wingman-pentaho
Copy link
Collaborator

Build Completed

🔥 This pull request has some issues. It would be preferable to fix them in order for it to be just perfect. See below for more details. Some links are also available below for further assistance in addressing those issues.

Build Commands

mvn -B -f 'pom.xml' -pl 'mondrian' -P '!assemblies' -DrunITs=true -Dsurefire.runOrder=alphabetical -Dfailsafe.runOrder=alphabetical -Daudit -amd clean install

Cleanup Commands

mvn -B -f 'pom.xml' -pl 'mondrian' -P '!assemblies' -amd build-helper:remove-project-artifact

Changed files

  mondrian/src/it/java/mondrian/olap/fun/CachedExistsTest.java
  mondrian/src/main/java/mondrian/olap/fun/BuiltinFunTable.java
  mondrian/src/main/java/mondrian/olap/fun/extra/CachedExistsFunDef.java
  mondrian/src/site/resources/doc/mdx.html

Integration Test Coverage

These statistics help you identify how your changes have affected the coverage of the following files. If a file is not in this list, then its coverage was not affected by your changes. To get some help interpreting these metrics, please refer to Jacoco's documentation.

⚠️ Coverage Changes (click to expand)
🆕 mondrian.olap.fun.extra.CachedExistsFunDef
  • Branch Coverage: 0%
  • Complexity Coverage: 20%
  • Instruction Coverage: 7.1%
  • Line Coverage: 12%
  • Method Coverage: 33.3%
mondrian.rolap.cache.SegmentCacheIndexImpl
  • Branch Change: -1.4% 🔻
  • Complexity Change: -2.2% 🔻
  • Instruction Change: -1.2% 🔻
  • Line Change: -1.5% 🔻
mondrian.rolap.FastBatchingCellReader
  • Branch Change: -1.9% 🔻
  • Complexity Change: -3.1% 🔻
  • Instruction Change: -0.4% 🔻
  • Line Change: -1.1% 🔻
mondrian.server.MonitorImpl.Handler
  • Branch Change: -2.2% 🔻
  • Complexity Change: -1.8% 🔻
  • Instruction Change: -0.5% 🔻
  • Line Change: -0.5% 🔻

@bennychow
Copy link
Contributor Author

@lucboudreau Hi Luc, I added the description to the function list HTML. If this looks good, can you merge this PR? Thanks

@mkambol mkambol merged commit 13c8f65 into pentaho:master Mar 4, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants