sgup432 commented on issue #15097:
URL: https://github.com/apache/lucene/issues/15097#issuecomment-3212567936

   I think the only good way I see is to use `RamUsageEstimator.sizeOf(query, 
0)` for queries not implementing Accountable instead of relying on 1kb. 
   
   @msfroh The approach you mentioned around short circuiting the visitor logic 
in case of too many clauses also might not work in some cases (like this one). 
For example, if a BooleanQuery has `FunctionScoreQuery` as one of the clause, 
`FunctionScoreQuery` holds `DoubleValuesSource` where a user can erroneously a 
huge sized source either via a custom based scoring function or for some vector 
use-case(like `FullPrecisionFloatVectorSimilarityValuesSource`). In such cases, 
the number of nested or child clauses may be small, but the overall query size 
can still be large, and with this logic it could still end up being cached.
   
   
   I did some experiments with different BooleanQueries and others, it was able 
to provide approx size pretty well. 
   What do you think? @msfroh 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to