summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBrian S. O'Neill <bronee@gmail.com>2007-03-31 18:48:54 +0000
committerBrian S. O'Neill <bronee@gmail.com>2007-03-31 18:48:54 +0000
commit07e1305c5ea574c673ba897ee3b3fbf3d5ec3861 (patch)
tree806894dea50f6c48b8da59e77c248aa026f8acbb /src
parent926dd4e7f74e482e046da5cc20991addb572e0ec (diff)
Fix score comparison to favor index with fewer remainders.
Diffstat (limited to 'src')
-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;
}