[
https://issues.apache.org/jira/browse/LUCENE-9114?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17026082#comment-17026082
]
David Smiley commented on LUCENE-9114:
--------------------------------------
I'd love it if you take it [~atris]; thanks! I have no WIP.
I was thinking that the typical cost could be something like DEF_COST + the sum
of costs of delegated FunctionValues. DEF_COST being say 5, perhaps less.
This way you don't think to much; you can mechanically add a bunch of cost
impls in this way. And if you or someone writes a different more thoughtful
cost, it'll be more apparent that it's not the default.
Maybe DoubleFieldSource should have an impl defaulting to its NumericDocValue's
cost(), maybe plus some constant. But no, NumericDocValues is a
DocIdSetIterator and the cost of that is the # of docs (100's of thousands
maybe), not the cost-per-lookup. Be mindful of the distinction.
I think the PR should be against master and make cost abstract, thus forcing
implementations to choose something sensible. The 8x backport should provide a
default implementation, though, for back-compat.
> Add FunctionValues.cost
> -----------------------
>
> Key: LUCENE-9114
> URL: https://issues.apache.org/jira/browse/LUCENE-9114
> Project: Lucene - Core
> Issue Type: Improvement
> Components: modules/query
> Reporter: David Smiley
> Priority: Major
>
> The FunctionRangeQuery uses FunctionValues.getRangeScorer which returns a
> subclass of ValueSourceScorer. VSC's TwoPhaseIterator has a matchCost impl
> that returns a constant 100. This is pretty terrible; the cost should vary
> based on the complexity of the ValueSource provided to FRQ. ValueSource's
> are typically nested a number of levels, so they should aggregate.
> BTW there is a parallel concern for FunctionMatchQuery which works with
> DoubleValuesSource which doesn't have a cost either, and unsurprisingly there
> is a TPI with matchCost 100 there.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]