[
https://issues.apache.org/jira/browse/SOLR-14765?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17486704#comment-17486704
]
Michael Gibney commented on SOLR-14765:
---------------------------------------
I addressed the special-case cursorMark issue that was giving me pause (thanks
[~mdrob] -- two years later I fully realize what you were suggesting wrt
cursorMark, haha).
More importantly, the last/main hesitation I had about this PR was:
{quote}
because it has the potential to affect cache usage patterns, we should probably
tread carefully and think through the possible negative consequences for some
use patterns{quote}
I think this was a potentially serious concern, because the fact that {{q}}
doesn't consult the filterCache (while {{fq}} does) is in some cases _the_
significant distinction between {{q}} and {{fq}} (even more than
score/no-score). If this optimization were to all of a sudden start implicitly
consulting the filterCache for constant-score main queries, it could be a _big_
problem for some use cases.
Accordingly, I modified the PR so that the optimization only _implicitly_
consults the filterCache for main query in the special case of
{{MatchAllDocsQuery}} -- for other constant score queries, it only consults the
filterCache when {{useFilterForSortedQuery=true}} (this setting defaults to
false). I think this respects the existing semantics of
{{useFilterForSortedQuery}}, and I think it makes sense to carve out a
special-case/exception for {{MatchAllDocsQuery}} because there's only _one_
such query, so nobody's going to accidentally blow out their filterCache that
way. (Also, the {{MatchAllDocsQuery}} case would be by far the more common case
for this optimization in practice, so this change isn't really _losing_ much
from the perspective of the optimization).
> optimize DocList creation by skipping sort for sort-irrelevant cases
> --------------------------------------------------------------------
>
> Key: SOLR-14765
> URL: https://issues.apache.org/jira/browse/SOLR-14765
> Project: Solr
> Issue Type: Improvement
> Affects Versions: 9.0
> Reporter: Michael Gibney
> Priority: Major
> Time Spent: 50m
> Remaining Estimate: 0h
>
> When {{rows=0}}, and for {{MatchAllDocsQuery}} and {{ConstantScoreQuery}}
> (and possibly others?), it is possible for
> {{SolrIndexSearcher.getDocListC(QueryResult, QueryCommand)}} to create a
> DocList directly from {{filterCache}} DocSets -- similar to
> {{useFilterForSortedQuery}}, but without actually sorting.
> This results in significant benefits for high-recall domains, including the
> common (and commonly-cached) use-case of {{q=\*:*}} and {{fq}}, facets, etc.
--
This message was sent by Atlassian Jira
(v8.20.1#820001)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]