From 5387b6b4e8c09ba248a4ded2f47a4edc4bc883b3 Mon Sep 17 00:00:00 2001
From: Fabio Pistolesi <fabio.pistolesi@forgerock.com>
Date: Fri, 24 Jul 2015 16:45:14 +0000
Subject: [PATCH] OPENDJ-2194 Index range search is equivalent to interval search only for single value attributes

---
 opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java |   10 +++++-----
 opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/AttributeIndex.java       |   10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/AttributeIndex.java b/opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/AttributeIndex.java
index 30effd8..c8f1c37 100644
--- a/opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/AttributeIndex.java
+++ b/opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/backends/jeb/AttributeIndex.java
@@ -502,11 +502,11 @@
       DatabaseEnvironmentMonitor monitor)
   {
     // TODO : this implementation is not optimal
-    // as it implies two separate evaluations instead of a single one,
-    // thus defeating the purpose of the optimization done
-    // in IndexFilter#evaluateLogicalAndFilter method.
-    // One solution could be to implement a boundedRangeAssertion that combine
-    // the two operations in one.
+    // as it implies two separate evaluations instead of a single one, thus defeating the purpose of
+    // the optimization done in IndexFilter#evaluateLogicalAndFilter method.
+    // One solution could be to implement a boundedRangeAssertion that combine the two operations in one.
+    // Such an optimization can only work for attributes declared as SINGLE-VALUE, though, since multiple
+    // values may match both filters with values outside the range. See OPENDJ-2194.
     StringBuilder tmpBuff1 = debugBuffer != null ? new StringBuilder(): null;
     StringBuilder tmpBuff2 = debugBuffer != null ? new StringBuilder(): null;
     EntryIDSet results1 = evaluate(filter1, tmpBuff1, monitor);
diff --git a/opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java b/opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java
index 0cce94a..3ab3628 100644
--- a/opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java
+++ b/opendj-sdk/opendj-server-legacy/src/main/java/org/opends/server/backends/pluggable/AttributeIndex.java
@@ -567,11 +567,11 @@
       SearchFilter filter1, SearchFilter filter2, StringBuilder debugBuffer, BackendMonitor monitor)
   {
     // TODO : this implementation is not optimal
-    // as it implies two separate evaluations instead of a single one,
-    // thus defeating the purpose of the optimization done
-    // in IndexFilter#evaluateLogicalAndFilter method.
-    // One solution could be to implement a boundedRangeAssertion that combine
-    // the two operations in one.
+    // as it implies two separate evaluations instead of a single one, thus defeating the purpose of
+    // the optimization done in IndexFilter#evaluateLogicalAndFilter method.
+    // One solution could be to implement a boundedRangeAssertion that combine the two operations in one.
+    // Such an optimization can only work for attributes declared as SINGLE-VALUE, though, since multiple
+    // values may match both filters with values outside the range. See OPENDJ-2194.
     StringBuilder tmpBuff1 = debugBuffer != null ? new StringBuilder() : null;
     StringBuilder tmpBuff2 = debugBuffer != null ? new StringBuilder() : null;
     EntryIDSet results1 = evaluate(indexQueryFactory, filter1, tmpBuff1, monitor);

--
Gitblit v1.10.0