Skipping scorer construction for clauses with zero cost - #15998
Conversation
3f4c393 to
5f94d7d
Compare
|
@msfroh mind taking this a look? |
|
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution! |
|
This change seem to introduce a hidden API contract change. IIUC currently, Ideally, when a clause matches no terms in a segment, the |
|
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution! |
Yeah I think my understanding was probably wrong here. I thought cost being 0 means no matches for sure, while cost>0 is an estimate. So the current approach taken in this PR is not right.
It might though I haven't checked it deep enough, will do. Thanks for the pointers. |
|
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution! |
|
This PR has not had activity in the past 2 weeks, labeling it as stale. If the PR is waiting for review, notify the dev@lucene.apache.org list. Thank you for your contribution! |
Description
Refer - #15887 for details
This skips the scorer construction for clauses with zero cost. As with the example given in above issue, if a user sends hundred of should clauses, and with most of them or ALL with zero cost, we still end up constructing the scorer leading to unnecessary CPU cycles consumption.