[jira] [Commented] (LUCENE-8864) Add Query Memory Estimation Ability in QueryVisitor

2019-06-18 Thread Atri Sharma (JIRA)


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

Atri Sharma commented on LUCENE-8864:
-

Right, the purpose of this Jira was twofold:

 

1) To throw out thoughts about making memory accounting a first class citizen 
within QueryVisitor. I think it would be good if we added a method which 
returned the overall size of the underlying query. This fits in nicely with 
QueryVisitor's model since queries can be nested, so it is good to get the 
"deep" memory usage of the parent query. As you said, the new method could 
return the Accountable's estimate or shallow size if Accountable is not 
supported.

 

2) Borrow ideas from QueryVisitor design to see if we can improve Accountable 
itself. While this is orthogonal and I have not really thought through every 
corner case, my instinct says that there might be opportunities to improve 
Accountable's APIs to be more recursive in nature. For eg, there are a ton of 
instanceof checks present today, for each Query type. Should we think about 
delegating some of that calculation to a visitor type model which localizes the 
per query calculation to the query's scope?

> Add Query Memory Estimation Ability in QueryVisitor
> ---
>
> Key: LUCENE-8864
> URL: https://issues.apache.org/jira/browse/LUCENE-8864
> Project: Lucene - Core
>  Issue Type: Improvement
>Reporter: Atri Sharma
>Priority: Major
>
> In LUCENE-8855, there is a discussion around adding memory accounting 
> capabilities to QueryVisitor to allow estimation of memory consumption by 
> queries.'
> This Jira tracks the effort



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

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



[jira] [Commented] (LUCENE-8864) Add Query Memory Estimation Ability in QueryVisitor

2019-06-18 Thread Andrzej Bialecki (JIRA)


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

Andrzej Bialecki  commented on LUCENE-8864:
---

What kind of API do you propose here? Theoretically, if a query tree contains 
queries that implement Accountable we can already use existing QueryVisitor API 
to walk through the query tree and collect ramBytesUsed() from each sub-query. 
And if a Query doesn't implement Accountable we have no way to predict this 
(apart from \{{RamUsageEstimator.shallowSizeOf(Object)}}).

> Add Query Memory Estimation Ability in QueryVisitor
> ---
>
> Key: LUCENE-8864
> URL: https://issues.apache.org/jira/browse/LUCENE-8864
> Project: Lucene - Core
>  Issue Type: Improvement
>Reporter: Atri Sharma
>Priority: Major
>
> In LUCENE-8855, there is a discussion around adding memory accounting 
> capabilities to QueryVisitor to allow estimation of memory consumption by 
> queries.'
> This Jira tracks the effort



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

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