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

Andrzej Bialecki  commented on LUCENE-8855:
-------------------------------------------

[~jpountz] - it's true that in most cases nobody cares about Query memory 
footprint, but the caching use case is an important one, and it needs more 
support from the API in order to better estimate the actual cost of caching.

I don't think using Weight#isCacheable helps in this particular scenario 
because you need to calculate Weight first, which brings its own significant 
cost.

QueryVisitor API is an option, sure, but still the Query implementation itself 
knows the best what its memory use is like, so it's still the Query impl that 
needs to calculate this estimate - and then report it, either using a method 
that's an extension of QueryVisitor or the already available Accountable.

> 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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to