[ 
https://issues.apache.org/jira/browse/OAK-9457?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17366505#comment-17366505
 ] 

Mohit Kataria commented on OAK-9457:
------------------------------------

Current implementation is that, we skip further cost evaluation of indexes if 
the bestCost < minCost of index under consideration and we explicitly set cost 
of the index less than minCost of that index to achieve skipping of cost 
estimation.

So even if two indexes have same minimum cost we will skip further evaluation 
(even though both are at par). This is the point of contention as next index 
can have less costPerExecution and hence lesser cost.

Updated the condition so that we skip cost evaluation of indexes if   "mincost 
of bestIndex" is < "mincost of index for which cost is being evaluated".

 

> Lucene index is always used over ES index when the cost is minimal
> ------------------------------------------------------------------
>
>                 Key: OAK-9457
>                 URL: https://issues.apache.org/jira/browse/OAK-9457
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: indexing
>    Affects Versions: 1.40.0
>            Reporter: Mohit Kataria
>            Assignee: Mohit Kataria
>            Priority: Major
>
> In case of suggestions and spellcheck i.e. native queries. The cost 
> evaluation for using index comes out to be 2.0 which is smaller than even 
> minimum cost of the indexes.
> This leads to non-evaluation of further index types. In this case elastic.
>  
> Minimum cost for indexes are as follows:
> ||Index Type||min cost||
> |reference index|1.0|
> |property index|2.0|
> |nodetype|2.05|
> |luceneproperty index|2.1|
> |elastic index:|2.2|
> |Lucene Aggregate Index|2.2|
> |Solr Aggegate Index|2.3|
>  
> Formulation for cost evaluation is :
> double c = p.getCostPerExecution() + entryCount * p.getCostPerEntry(); 
> Which for native queries is equivalent to 1.0 + 1.0 * 1.0 i.e 2.0.
> So make sure that index evaluation is not stopped at lucene indexes we are 
> going to change EstimatedEntryCount to 2 from 1 which will return cost for 
> suggestions and spellcheck as 3.0
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to