summaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2008-07-12 06:10:18 +0000
committerBrian S. O'Neill <bronee@gmail.com>2008-07-12 06:10:18 +0000
commit9afe8abca1ae161905f1bcb179479a279580b6c8 (patch)
tree2ff2c46067db968c2d01150867ddb771675e7b00 /src/main
parentaebf83af8e02c9ff49a4d1ec64632e7137c71963 (diff)
Fix remainder append for full scan queries with 'or' expressions.
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java8
-rw-r--r--src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java2
2 files changed, 7 insertions, 3 deletions
diff --git a/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java
index 875eda3..d7f30c8 100644
--- a/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java
+++ b/src/main/java/com/amazon/carbonado/qe/IndexedQueryAnalyzer.java
@@ -474,9 +474,13 @@ public class IndexedQueryAnalyzer<S extends Storable> {
* Returns a new result with the remainder filter replaced.
*/
public Result withRemainderFilter(Filter<S> remainderFilter) {
+ Filter<S> handledFilter = getCompositeScore().getFilteringScore().getHandledFilter();
+
+ Filter<S> filter = andFilters(handledFilter, remainderFilter);
+
CompositeScore<S> score = mScore.withRemainderFilter(remainderFilter);
- return new Result(mFilter, score, mLocalIndex,
- mForeignIndex, mForeignProperty, mHints);
+
+ return new Result(filter, score, mLocalIndex, mForeignIndex, mForeignProperty, mHints);
}
/**
diff --git a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
index 6e5262f..17e84ad 100644
--- a/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
+++ b/src/main/java/com/amazon/carbonado/qe/UnionQueryAnalyzer.java
@@ -426,7 +426,7 @@ public class UnionQueryAnalyzer<S extends Storable> implements QueryExecutorFact
if (mergedResults.size() == 0) {
// Nothing was exempt. Rather than return a result with a dnf
// filter, return full scan with a simpler reduced filter.
- full.withRemainderFilter(filter.reduce());
+ full = full.withRemainderFilter(filter.reduce());
}
mergedResults.add(full);