[ 
https://issues.apache.org/jira/browse/SOLR-16546?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17636235#comment-17636235
 ] 

Shawn Heisey commented on SOLR-16546:
-------------------------------------

{quote}Hopefully CaffeineCache's algorithm will easily identify this as an 
eviction candidate if it's not re-used.
{quote}
I wonder what happens if say your cache size is set to 100 and you get 5000 
different queries with a facet. Is the cache going to choose to evict the 
facet-related "q parameter" entries with low hitcounts, leaving the 
filter-related entries with many hits, or will it eventually evict ALL the 
entries including the filters? [~ben.manes] has already indicated on my cache 
dumper issue that Caffeine does not track an explicit per-entry hitcount, it 
figures out which entry to evict through some fuzzy logic.  Hopefully it will 
always choose to evict the facet-related entries.

> Faceting puts an entry for each q into the filterCache 
> -------------------------------------------------------
>
>                 Key: SOLR-16546
>                 URL: https://issues.apache.org/jira/browse/SOLR-16546
>             Project: Solr
>          Issue Type: Improvement
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: faceting
>    Affects Versions: 9.0
>            Reporter: Andy Lester
>            Priority: Minor
>
> I noticed that I was getting far more entries in the filterCache than I was 
> expecting. All my app's FQs are driven by the app itself. There are only a 
> couple dozen FQs possible in our queries, but I'd be getting ~10K cache 
> ejections every hour. That didn't make any sense.
> So I investigated and discovered that making a query using facets adds an 
> entry to the filterCache. Here's my demonstration.
> The script show-results is this:
> {{curl -s "$URL/twit/admin/cache" | jq -S .queries
> curl -s "$URL/admin/metrics" | jq 
> '.metrics."solr.core.twit"."CACHE.searcher.filterCache".inserts'
> }}
> The /admin/cache handler is Shawn Heisey's cache dumper he's working on in 
> ticket SOLR-15859. 
> {{# Freshly started Solr. No cache entries.
> $ ./show-results
> {}
> 0
> # Query on "alpha" with facets on.
> $ curl -s $URL/twit/select?q=title:alpha&rows=0&facet=on&facet.field=grouping
> # Now there is a filter cache entry.
> $ ./show-results
> {
>   "title:alpha": 0
> }
> 1
> # Query on "beta" with facets on. "beta" shows up in the cache.
> $ curl -s $URL/twit/select?q=title:beta&rows=0&facet=on&facet.field=grouping
> $ ./show-results
> {
>   "title:alpha": 0,
>   "title:beta": 0
> }
> 2
> # Now query on "gamma" with facets OFF.
> $ curl -s $URL/twit/select?q=title:gamma&rows=0&facet=off&facet.field=grouping
> # The "gamma" does not show up in the filter cache.
> $ ./show-results
> {
>   "title:alpha": 0,
>   "title:beta": 0
> }
> 2
> # Now do same query on "gamma" with facets ON.
> $ curl -s $URL/twit/select?q=title:gamma&rows=0&facet=on&facet.field=grouping
> # The "gamma" shows up.
> $ ./show-results
> {
>   "title:alpha": 0,
>   "title:beta": 0,
>   "title:gamma": 0
> }
> 3
> }}
> Is this correct behavior? Do I need to adjust my filterCache to allow for 
> this?



--
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