You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Johannes Siegert <jo...@marktjagd.de> on 2015/11/30 10:46:35 UTC

optimize cache-hit-ratio of filter- and query-result-cache

Hi,

some of my solr indices have a low cache-hit-ratio.

1 Does sorting the parts of a single filter-query have impact on 
filter-cache- and query-result-cache-hit-ratio?
1.1 Example: fq=field1:(2 or 3 or 1) to fq=field1:(1 or 2 or 3) -> if 
1,2,3 are randomly sorted
2 Does sorting the parts of the query have impact on 
query-result-cache-hit-ratio?
2.1 Example: "q=abc&fq=field1:abc&sort=field1 
desc&fq=field2:xyz&sort=field2 asc" to 
"q=abc&fq=field1:abc&fq=field2:xyz&sort=field1 desc&sort=field2 asc" -> 
if the query parts are randomly sorted

Thanks!

Johannes


Re: optimize cache-hit-ratio of filter- and query-result-cache

Posted by Erick Erickson <er...@gmail.com>.
1.1> Absolutely. The filterCache is simply a map. The key is the fq clause, so
fq=field1:(1 OR 2 OR 3) is different than fq=field1:(3 OR 2 OR 1).

2.1> not sure. But don't get very hung up on queryResultCache. It's
useful pretty much for
paging and the hit ration is often very low as it only gets used for
the _exact_ same query
with a different rows parameter. And it doesn't store the full result
set, just the size configured
in solrconfig.xml.

Mikhail was pointing you to the admin>>core>>plugins/stats>>cache>> page.
You can fire your alternate queries and filter queries at Solr and examine the
filterCache and queryResultCache numbers before and after.

Best,
Erick

On Tue, Dec 1, 2015 at 12:03 AM, Johannes Siegert
<jo...@marktjagd.de> wrote:
> Thanks. The statements on http://wiki.apache.org/solr/SolrCaching#showItems
> are not explicitly enough for my question.
>

Re: optimize cache-hit-ratio of filter- and query-result-cache

Posted by Johannes Siegert <jo...@marktjagd.de>.
Thanks. The statements on 
http://wiki.apache.org/solr/SolrCaching#showItems are not explicitly 
enough for my question.


Re: optimize cache-hit-ratio of filter- and query-result-cache

Posted by Mikhail Khludnev <mk...@griddynamics.com>.
On Mon, Nov 30, 2015 at 12:46 PM, Johannes Siegert <
johannes.siegert@marktjagd.de> wrote:

> Hi,
>
> some of my solr indices have a low cache-hit-ratio.
>
> 1 Does sorting the parts of a single filter-query have impact on
> filter-cache- and query-result-cache-hit-ratio?
> 1.1 Example: fq=field1:(2 or 3 or 1) to fq=field1:(1 or 2 or 3) -> if
> 1,2,3 are randomly sorted
>
Yes it does, probably. However, there is an ongoing discussion in some
jira, iirc.


> 2 Does sorting the parts of the query have impact on
> query-result-cache-hit-ratio?
> 2.1 Example: "q=abc&fq=field1:abc&sort=field1
> desc&fq=field2:xyz&sort=field2 asc" to
> "q=abc&fq=field1:abc&fq=field2:xyz&sort=field1 desc&sort=field2 asc" -> if
> the query parts are randomly sorted
>
Nope. fwiw, I wonder if several sort params make sense.

This is exactly a case when it's easier to experiment checking cache stats
in SolrAdmin, than trust any advice.
btw,
can't http://wiki.apache.org/solr/SolrCaching#showItems help to answer your
questions?


>
> Thanks!
>
> Johannes
>
>


-- 
Sincerely yours
Mikhail Khludnev
Principal Engineer,
Grid Dynamics

<http://www.griddynamics.com>
<mk...@griddynamics.com>