kotman12 commented on PR #16998: URL: https://github.com/apache/lucene/pull/16998#issuecomment-6813209195
> Thanks for opening @kotman12, this looks very cool. It is obviously a lot to review at once so I will take some time over it, if that's OK. Do you have any numbers on how it performs for your usecases? @romseygeek Yes of course, thanks for taking a look! Re the size: I apologize for the diff. Although it is mostly tests it is still quite large and touches existing components. As I was putting this together I did two refactors that were tangential but IMO helped the readability of the full change as it stands: 1. addition of `TermsCollector` interface (minor breaking change) 2. Modeling the `QueryTree` as `Leaf` and `Clauses` without the generic functional java glue that obfuscates the call graph. If it helps with review (and assuming you agree these make sense) I can split these out as separate PRs. Let me know if you'd like me to do that. Re performance: Obviously a lot depends on the type of queries. I have two datasets and each had a different response to this patch but both were positive. The main benefit is it makes the `MultiPassTermFilteredPresearcher` extremely efficient even at high levels of passes. Below are some presearch ratio and `Monitor` mean wall-time matching one document at a time: | Passes | Query Set | Baseline ratio | PR ratio | Baseline ms | PR ms | |---|---|---|---|---|---| | 4 | Set 1 | 15.4% | 20.6% | 67.3 | 53.0 | | 4 | Set 2 | 4.4% | 11.5% | 193.5 | 85.8 | | 6 | Set 1 | 16.2% | 23.6% | 64.0 | 48.5 | | 6 | Set 2 | 4.7% | 22.9% | 169.3 | 48.5 | It also vastly improves P99 presearch ratios (times are nearly perfectly correlated): | Passes | Query Set | Baseline | PR | |---|---|---|---| | 4 | Set 1 | 2.6% | 7.3% | | 4 | Set 2 | 2.5% | 6.7% | | 6 | Set 1 | 2.8% | 11.8% | | 6 | Set 2 | 2.7% | 11.7% | The bigger win for this dataset was actually a separate patch I put together to treat point queries as term queries (both sets have a lot of non-range, single point queries in addition to the negative queries). Once you have this _and_ negative queries handled the performance gets insane as multi-pass "saturation" of the combined effect is even better than any one alone: | Passes | Query Set | Baseline ratio | Points ratio | PR + Points ratio | Baseline ms | Points ms | PR + Points ms | |---|---|---|---|---|---|---|---| | 4 | Set 1 | 15.4% | 41.9% | 52.6% | 67.3 | 33.9 | 28.1 | | 4 | Set 2 | 4.4% | 13.9% | 27.8% | 193.5 | 93.9 | 56.9 | | 6 | Set 1 | 16.2% | 48.5% | 62.5% | 64.0 | 27.6 | 23.8 | | 6 | Set 2 | 4.7% | 16.5% | 54.9% | 169.3 | 68.8 | 27.8 | P99 pre-search ratios: | Passes | Query Set | Baseline | Points | PR + Points | |---|---|---|---|---| | 4 | Set 1 | 2.6% | 8.4% | 17.6% | | 4 | Set 2 | 2.5% | 8.1% | 16.6% | | 6 | Set 1 | 2.8% | 10.1% | 41.2% | | 6 | Set 2 | 2.7% | 9.8% | 40.0% | As I mentioned the Points handling is a "dirty" patch, ideally we'd also handle range queries (just as percolator does) efficiently which is why it is not PR ready. But I did start thinking about this and raised https://github.com/apache/lucene/issues/17005 for your awareness. I think there are some design decisions to iron out before anything should be proposed. > [!IMPORTANT] I just want to reiterate how amazed I am that with 6 passes + negation + points handling I am able to get ~40% presearch ratio for the _99th percentile_ (!) for both datasets. This beats my previous _mean_ presearch ratio by almost 3X. -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
