thomasmueller commented on code in PR #2912:
URL: https://github.com/apache/jackrabbit-oak/pull/2912#discussion_r3288770347


##########
oak-search/src/main/java/org/apache/jackrabbit/oak/plugins/index/search/spi/query/FulltextIndexPlanner.java:
##########
@@ -960,6 +977,116 @@ private int getMaxPossibleNumDocs(Map<String, 
PropertyDefinition> propDefns, Fil
         return minNumDocs;
     }
 
+    /**
+     * OAK-12221: cost estimation using a multiplicative selectivity model.
+     * <p>
+     * Each indexed condition contributes a selectivity (the probability that 
a document
+     * satisfies the condition, given it has the field): {@code mcvFraction} 
for MCV matches,
+     * {@code 1/weight} when only a weight is known, and {@code 1.0} when 
{@code weight == 1}.
+     * The combined selectivity is the product of all per-condition 
selectivities, applied
+     * once at the end against the most restrictive field's doc count. This 
makes the
+     * estimate independent of iteration order.
+     */
+    private int getMaxPossibleNumDocsBySelectivity(Map<String, 
PropertyDefinition> propDefns, Filter filter) {

Review Comment:
   
   Well, all the new tests are actually testing this new method...



-- 
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]

Reply via email to