Minor changes based on Alex's comments.
git-svn-id: https://asterixdb.googlecode.com/svn/branches/asterix_lsm_stabilization@1132 eaa15691-b419-025a-1212-ee371bd00084
diff --git a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/BTreeAccessMethod.java b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/BTreeAccessMethod.java
index 6e8d11a..00a0f34 100644
--- a/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/BTreeAccessMethod.java
+++ b/asterix-algebra/src/main/java/edu/uci/ics/asterix/optimizer/rules/am/BTreeAccessMethod.java
@@ -1,6 +1,7 @@
package edu.uci.ics.asterix.optimizer.rules.am;
import java.util.ArrayList;
+import java.util.Arrays;
import java.util.BitSet;
import java.util.HashSet;
import java.util.Iterator;
@@ -291,22 +292,18 @@
return null;
}
+ // If the select condition contains mixed open/closed intervals on multiple keys, then we make all intervals closed to obtain a superset of answers and leave the original selection in place.
boolean primaryIndexPostProccessingIsNeeded = false;
- // If the condition is a mixed open/closed intervals due to a composite key, then we will make all open all the intervals and will do post-processing later.
for (int i = 1; i < numSecondaryKeys; ++i) {
if (lowKeyInclusive[i] != lowKeyInclusive[0]) {
- for (int j = 0; j < numSecondaryKeys; ++j) {
- lowKeyInclusive[j] = true;
- }
+ Arrays.fill(lowKeyInclusive, true);
primaryIndexPostProccessingIsNeeded = true;
break;
}
}
for (int i = 1; i < numSecondaryKeys; ++i) {
if (highKeyInclusive[i] != highKeyInclusive[0]) {
- for (int j = 0; j < numSecondaryKeys; ++j) {
- highKeyInclusive[j] = true;
- }
+ Arrays.fill(highKeyInclusive, true);
primaryIndexPostProccessingIsNeeded = true;
break;
}