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

Chetan Mehrotra edited comment on OAK-4904 at 10/7/16 9:52 AM:
---------------------------------------------------------------

[patch|^OAK-4904-v1.patch] for the same. The test fails on 1.4 also 

[~tmueller] - Please review the patch. There is TODO left around should be 
remove the count calculation altogether for unique indexes. Fix used here is 
return the minimum cost in case query can be handled by a unique index


was (Author: chetanm):
[patch|^OAK-4904-v1.patch] for the same. The test fails on 1.4 also 

[~tmueller] - Please review the patch. There is TODO left around should be 
remove the count calculation altogether for unique indexes 

> For unique indexes avoid consulting indexes other than property index
> ---------------------------------------------------------------------
>
>                 Key: OAK-4904
>                 URL: https://issues.apache.org/jira/browse/OAK-4904
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: query
>            Reporter: Chetan Mehrotra
>            Assignee: Chetan Mehrotra
>              Labels: performance
>             Fix For: 1.6
>
>         Attachments: OAK-4904-v1.patch
>
>
> Currently for queries involving unique index like 
> {noformat}
> SELECT * FROM [nt:base] WHERE [jcr:uuid] = $id
> {noformat}
> QueryEngine would start consulting all types of index in order of minimum 
> cost. Where minimum cost are
> * PropertyIndex - 2.0
> * LucenePropertyIndex - 2.1
> For such queries in case of match property index returns a cost of (base) 2 + 
> (count) 1 = 3 due to which QE has to consult Lucene index also. Given such 
> queries a very frequent it would be better to avoid consulting Lucene index 
> as that adds unnecessary overhead



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to