summaryrefslogtreecommitdiff
path: root/src/main/java/com/amazon
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/amazon')
-rw-r--r--src/main/java/com/amazon/carbonado/qe/FilteringScore.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/main/java/com/amazon/carbonado/qe/FilteringScore.java b/src/main/java/com/amazon/carbonado/qe/FilteringScore.java
index ebbb189..5655a84 100644
--- a/src/main/java/com/amazon/carbonado/qe/FilteringScore.java
+++ b/src/main/java/com/amazon/carbonado/qe/FilteringScore.java
@@ -788,10 +788,19 @@ public class FilteringScore<S extends Storable> {
return 1;
}
+ // Favor index which contains fewer remainders.
+ if (first.getRemainderCount() < second.getRemainderCount()) {
+ return -1;
+ }
+ if (first.getRemainderCount() > second.getRemainderCount()) {
+ return 1;
+ }
+
// Favor index which contains more weak matches.
if (first.getWeakMatchCount() > second.getWeakMatchCount()) {
return -1;
- } else if (first.getWeakMatchCount() < second.getWeakMatchCount()) {
+ }
+ if (first.getWeakMatchCount() < second.getWeakMatchCount()) {
return 1;
}