Hello,

I've been checking the code of the IndexPlanner (apache OAK 1.4.1) and I
was surprised because the costPerEntryFactor remains 1 in both cases:

   - when no property indexed or sorted match any property clause or sort
   clause from the query
   - when only an indexed or sorted property matches a property clause or
   sort clause from the query

Although this piece of code avoids a division by zero (see
org.apache.jackrabbit.oak.plugins.index.lucene.IndexPlanner lines 201-203)

            if (costPerEntryFactor == 0){
                costPerEntryFactor = 1;
            }

It also avoids the boosting of indexes that match 1 query clause (or in
other words, it doesn't penalize indexes that don't match any clause). I'm
thinking about opening an issue. Although it is for the long-tern, actually
I would like to know which index is selected in case that more than one had
the same cost.

Regards.

Reply via email to