You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@solr.apache.org by GitBox <gi...@apache.org> on 2022/11/18 16:43:55 UTC

[GitHub] [solr] dsmiley commented on a diff in pull request #1184: SOLR-16555: SolrIndexSearcher - FilterCache intersections/andNot should not clone bitsets repeatedly

dsmiley commented on code in PR #1184:
URL: https://github.com/apache/solr/pull/1184#discussion_r1026647448


##########
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java:
##########
@@ -1211,17 +1211,22 @@ public ProcessedFilter getProcessedFilter(DocSet setFilter, List<Query> queries)
     }
 
     // Are all of our normal cached filters negative?
-    if (end > 0 && answer == null) {
-      answer = getLiveDocSet();
-    }
+    if (end > 0) {

Review Comment:
   As I said, I think we shouldn't do this if equals to 1 since there will be at most one copy any way (sometimes optimizations lead to none).  Furthermore, consider that "answer" may be a SortedIntDocSet and thus upgrading it to a BitSet may be wasteful.



##########
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java:
##########
@@ -1211,17 +1211,22 @@ public ProcessedFilter getProcessedFilter(DocSet setFilter, List<Query> queries)
     }
 
     // Are all of our normal cached filters negative?
-    if (end > 0 && answer == null) {
-      answer = getLiveDocSet();
-    }
+    if (end > 0) {

Review Comment:
   Come to think of it, if "answer" is an instance of SortedIntDocSet, let's not do this optimization at all; right?



##########
solr/core/src/java/org/apache/solr/search/SolrIndexSearcher.java:
##########
@@ -1211,17 +1211,22 @@ public ProcessedFilter getProcessedFilter(DocSet setFilter, List<Query> queries)
     }
 
     // Are all of our normal cached filters negative?
-    if (end > 0 && answer == null) {
-      answer = getLiveDocSet();
-    }
+    if (end > 0) {

Review Comment:
   Also, iff smallestIdx is >= 0 then "end" is effectively one smaller for the purposes of this check.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@solr.apache.org
For additional commands, e-mail: issues-help@solr.apache.org