[ 
https://issues.apache.org/jira/browse/SOLR-16546?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Andy Lester updated SOLR-16546:
-------------------------------
    Description: 
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 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?

  was:
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 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?


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