MaxScoreBulkScorer increased latency for a extreme test case (many SHOULD and each SHOULD clause matches all docs)
Rui Wu <[email protected]> Mon, 16 Sep 2024 13:00:14 -0700
| Newsgroups | gmane.comp.jakarta.lucene.user |
|---|---|
| Message-ID | <CABEQ2evNM1K_trZLQUgxg0AhKLGyrVWbRHjj9vzC-LR1kb4AWg@mail.gmail.com> |
Dear experts,
In our Mongodb Atlas Search performance regression test between Lucene 9.7
and Lucene 9.11, we detect a 43% latency regression in this query shape:
12 SHOULD clause, and each clause matches all of the documents. Each should
clause is wrapped in ConstantScoreQuery.
The index has 3.6 documents, and every document is identical: Every
document is {"path": ["1", "2", "3" ... "12"]}
The query shape is a BooleanQuery of SHOULD "1", SHOULD "2", ... SHOULD
"12".
Our flamegraphs show that most of the time in search() is spent on
the MaxScoreBulkScorer class:
[image: image.png]
We wonder if this extreme test case is expected to be slow on
MaxScoreBulkScorer?
Thanks a lot!
Rui Wu
Lead Engineer, MongoDB