[ https://issues.apache.org/jira/browse/LUCENE-9857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17314006#comment-17314006 ]
Julie Tibshirani commented on LUCENE-9857: ------------------------------------------ Hello [~gf2121]! I think that when we cache an IndexOrDocValueQuery, we always make sure to use the 'index' version. This is because we pass a lead cost of {{Long.MAX_VALUE}} when building the scorer: https://github.com/apache/lucene/blob/main/lucene/core/src/java/org/apache/lucene/search/LRUQueryCache.java#L769. Are you seeing a surprising behavior in tests/ benchmarks that led you to file the issue? It could be that we're still missing some detail. > Skip cache building if IndexOrDocValuesQuery choose the dvQuery > --------------------------------------------------------------- > > Key: LUCENE-9857 > URL: https://issues.apache.org/jira/browse/LUCENE-9857 > Project: Lucene - Core > Issue Type: Improvement > Components: core/search > Affects Versions: main (9.0) > Reporter: Feng Guo > Priority: Major > Time Spent: 10m > Remaining Estimate: 0h > > IndexOrDocValuesQuery can automatically use dvQueries when the cost > 8 *l > eadcost, And the LRUQueryCache skips cache building when cost > 250(By > default) * leadcost. There is a gap between 8 and 250, which means if the > factor is just between 8 and 250 (e.g. cost = 10 * leadcost), the > IndexOrDocValueQuery will choose the dvQueries but LRUQueryCache still build > cache for it. > IndexOrDocValuesQuery aims to speed up queries when the leadcost is small, > but building cache by dvScorers can make it meaningless because it needs to > scan all the docvalues. This can be rather slow for big segments, so maybe we > should skip the cache building for IndexOrDocValuesQuery when it chooses > dvQueries. -- 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