bq: Does that make sense?

In a word, yes. Without {!cache=false}, each and
every document in the entire corpus is examined
and a bitset constructed that represents that
result set, then the entry in the filter cache is
constructed.

With cache=false, only docs that make it through the
rest of the clauses (main query clause, all the other
fq clauses that do NOT have cache=false etc) and
no entry is made in the filter cache.

This extra work takes time, and is only worth paying
when there is a high probability that the fq clause
will be re-used in the future.

So if you _know_ that the fq clause is unlikely to be
used again, then adding cache=false is the right thing
to do.

Do be aware that fq clauses with date
fqs that use a bare NOW clause is an anti-pattern,
see:
https://lucidworks.com/blog/date-math-now-and-filter-queries/

Best,
Erick

On Mon, Aug 24, 2015 at 8:46 AM, wwang525 <wwang...@gmail.com> wrote:
> Hi All,
>
> I am working on improving query performance of queries that is based on 15 M
> records, and all the queries have a list of about 6 filter queries with
> grouping and faceting requirements.
>
> So far, I found that the cache setting in solrconfig.xml is helpful after
> the Solr server is warmed up. Then the average response time stayed at about
> 500 ms / per request whether under load or not. The analysis of the query
> statistics indicated the performance "bottleneck" is in "query", and not
> "facet". I was looking for ways to improve it further.
>
> After I put !cache=false in front of the list of filter queries, and test
> individual queries (not under load),  the performance seemed to be boosted
> quite a lot. For example, when I tested the 10th query, I got a 130 ms
> response time with !cache=false. However, without setting !cache=false, I
> typically got 500ms response time for the query.
>
> In all the 10 queries I tested (one by one), the response time were
> consistently much better with !cache=false.
>
> Does it make sense?
>
> Thanks
>
>
>
> --
> View this message in context: 
> http://lucene.472066.n3.nabble.com/Performance-gain-with-setting-cache-false-in-the-query-for-complex-queries-tp4224931.html
> Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to