apache / apache/lucene

Pruning of estimating the point value count since BooleanScorerSupplier

Open
#13,554 2 comments 0 reactions 0 assignees View on GitHub
type:enhancement
Dominant language
Java
Stars
3.6k
Forks
1.4k
Avg merge
2d 11h
Merged PRs (30d)
88

Description

### Description

In #13199, we add `isEstimatedPointCountGreaterThanOrEqualTo` to dynamic pruning in the point value, there also too many functions call `estimatePointCount` directly, dynamic pruning is not used.
https://github.com/apache/lucene/blob/295c5d35767c2af9361f79dfc11511ad5ababd81/lucene/core/src/java/org/apache/lucene/index/PointValues.java#L387

One of my ideas is pruning since BooleanScorerSupplier:
https://github.com/apache/lucene/blob/295c5d35767c2af9361f79dfc11511ad5ababd81/lucene/core/src/java/org/apache/lucene/search/BooleanScorerSupplier.java#L318

The example is as follow:
```
long leadCost = Long.MAX_VALUE;
leadCost = subs.get(Occur.MUST).stream().mapToLong(ScorerSupplier::cost(leadCost)).min().orElse(Long.MAX_VALUE);
leadCost =
subs.get(Occur.FILTER).stream().mapToLong(ScorerSupplier::cost(leadCost)).min().orElse(leadCost);
```

If it's a good idea, if is, I'm pleasure to implement.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.