diff options
author | Brian S. O'Neill <bronee@gmail.com> | 2007-03-31 18:48:54 +0000 |
---|---|---|
committer | Brian S. O'Neill <bronee@gmail.com> | 2007-03-31 18:48:54 +0000 |
commit | 07e1305c5ea574c673ba897ee3b3fbf3d5ec3861 (patch) | |
tree | 806894dea50f6c48b8da59e77c248aa026f8acbb | |
parent | 926dd4e7f74e482e046da5cc20991addb572e0ec (diff) |
Fix score comparison to favor index with fewer remainders.
-rw-r--r-- | src/main/java/com/amazon/carbonado/qe/FilteringScore.java | 11 |
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;
}
|