Kevin Risden created SOLR-17131:
-----------------------------------

             Summary: Optimize rows=0 queries since score/sort isn't necessary
                 Key: SOLR-17131
                 URL: https://issues.apache.org/jira/browse/SOLR-17131
             Project: Solr
          Issue Type: Improvement
      Security Level: Public (Default Security Level. Issues are Public)
            Reporter: Kevin Risden
            Assignee: Kevin Risden


If a query has rows=0 Solr does not need to sort the results or even compute 
the score. This means the filterCache can be more efficient to compute the 
result and Solr doesn't spend time on unnecessarily sorting and scoring large 
result sets for it to be thrown away.

This was found while looking at 
https://issues.apache.org/jira/browse/SOLR-14765 and trying to reason through 
the case of rows=0 that are sometimes used to just determine count of matching 
results. This change adds the check for rows=0 before other checks to ensure 
that we can short circuit scoring even if there is a scoring query. We also 
don't add the query to the filter cache since that could result in filter cache 
thrashing.

In some tests, we found that queries with rows=0 p99 improved by 50% and CPU 
dropped by 5%.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to