lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Adrien Grand (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-8855) Add Accountable to Query implementations
Date Fri, 14 Jun 2019 16:33:00 GMT

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

Adrien Grand commented on LUCENE-8855:
--------------------------------------

I had the temptation to make Query implement Accountable a couple times over the past years
but I never liked it as it felt like something that is only really useful in esoteric cases
when memory usage of the cache keys - queries - is not negligible compared to what is being
cached. I'd rather not implement Accountable.

My preference would be to either rely on the existing Weight#isCacheable logic, which disables
caching on large queries (see e.g. https://github.com/apache/lucene-solr/blob/fbd05167f455e3ce2b2ead50336e2b9c2521cd6c/lucene/core/src/java/org/apache/lucene/search/TermInSetQuery.java#L337-L342)
so that queries that are used as cache keys are always small. Or alternatively compute a rough
estimate of the memory usage of queries on top of the Query API by using the query visitor
API and some heuristics.

> Add Accountable to Query implementations
> ----------------------------------------
>
>                 Key: LUCENE-8855
>                 URL: https://issues.apache.org/jira/browse/LUCENE-8855
>             Project: Lucene - Core
>          Issue Type: Improvement
>            Reporter: Andrzej Bialecki 
>            Assignee: Andrzej Bialecki 
>            Priority: Major
>         Attachments: LUCENE-8855.patch, LUCENE-8855.patch
>
>
> Query implementations should also support {{Accountable}} API in order to monitor the
memory consumption e.g. in caches where either keys or values are {{Query}} instances.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message