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

Atri Sharma commented on LUCENE-8027:
-------------------------------------

I think this is a great idea -- should really help with costly queries 
especially when one clause is dominating the others in terms of cost.

In terms of how this will work with LUCENE-8213, I believe we should relax the 
cost parameters a bit when asynchronous caching is enabled i.e. we should not 
cache a query with async caching enabled when the cost is 15x higher, and not 
cache when cost difference > 10x for sync queries.

> Do not cache clauses if they might make the query more than X times slower
> --------------------------------------------------------------------------
>
>                 Key: LUCENE-8027
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8027
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Adrien Grand
>            Priority: Minor
>         Attachments: LUCENE-8027.patch
>
>
> Query caching can have a negative impact on tail latencies as the clause that 
> is cached needs to be entirely consumed. Maybe we could leverage the fact 
> that we can know the lead cost from any scorer now (LUCENE-7897) in order to 
> implement heuristics that would look  like "do not cache clause X if its cost 
> is 10x greater than the cost of the entire query". This would make sure that 
> a fast query can not become absurdly slow just because it had to cache a 
> costly filter. The filter will need to wait for a more costly query to be 
> cached, or might never be cached at all.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org
For additional commands, e-mail: issues-h...@lucene.apache.org

Reply via email to