Skip to content

Commit

Permalink
mondrian: optimize named set caching
Browse files Browse the repository at this point in the history
[git-p4: depot-paths = "//open/mondrian/": change = 9336]
  • Loading branch information
Rushan Chen committed May 26, 2007
1 parent 4a14bee commit 26f11f1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 18 deletions.
14 changes: 0 additions & 14 deletions src/main/mondrian/rolap/RolapEvaluator.java
Expand Up @@ -180,12 +180,6 @@ protected Object evaluateNamedSet(String name, Exp exp) {
throw new UnsupportedOperationException();
}

/**
* Clears cached values for all named sets.
*/
protected void clearNamedSets() {
}

/**
* First evaluator calls this method on construction.
*/
Expand Down Expand Up @@ -672,14 +666,6 @@ public Object getCachedResult(ExpCacheDescriptor cacheDescriptor) {

public void clearExpResultCache() {
root.expResultCache.clear();

// Clear cached named sets at the same time we clear other cached
// expressions. This may be overconservative in some cases, but
// without this, there can be bugs when incorrect results get cached
// for named sets which depend on measures which haven't been loaded
// yet. See mondrian.test.clearview.CVBasicTest.testLer4260 for an
// example.
root.clearNamedSets();
}

public boolean isNonEmpty() {
Expand Down
6 changes: 2 additions & 4 deletions src/main/mondrian/rolap/RolapResult.java
Expand Up @@ -809,6 +809,8 @@ private Object evaluateExp(Calc calc, Evaluator evaluator) {
ev.setCellReader(batchingReader);
Object preliminaryValue = calc.evaluate(ev);
Util.discard(preliminaryValue);
ev.clearExpResultCache();

if (!batchingReader.loadAggregations(evaluator.getQuery())) {
break;
}
Expand Down Expand Up @@ -1248,10 +1250,6 @@ protected Object evaluateNamedSet(String name, Exp exp) {
return value;
}

protected void clearNamedSets() {
namedSetValues.clear();
}

public Object getParameterValue(ParameterSlot slot) {
Object value = slot.getParameterValue();
if (value != null) {
Expand Down

0 comments on commit 26f11f1

Please sign in to comment.