You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Amit Jain (JIRA)" <ji...@apache.org> on 2015/03/16 09:55:38 UTC
[jira] [Updated] (OAK-2081) [Ordered Index] Incorrect index plan
selection
[ https://issues.apache.org/jira/browse/OAK-2081?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Amit Jain updated OAK-2081:
---------------------------
Priority: Minor (was: Major)
> [Ordered Index] Incorrect index plan selection
> -----------------------------------------------
>
> Key: OAK-2081
> URL: https://issues.apache.org/jira/browse/OAK-2081
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: query
> Reporter: Amit Jain
> Priority: Minor
> Attachments: OAK-2081.patch
>
>
> When an ordered index is defined on multiple properties the plan selection seems to be incorrect. There are a few potential problems :
> * For > or < conditions, the cost is doubled because of incorrect condition in {{OrderedContentMirrorStoreStrategy#count}}. The condition should be {{cost >= max}} instead of {{count > max}}
> * If multiple properties are specified in the index definition, only the first property is indexed and others ignored. IMO only the first should be used when selecting the plan in {{OrderedPropertyIndexLookup#getIndexNode()}}, otherwise it may happen that the property restriction that is not indexed is used for the index plan.
> * In {{QueryImpl#getBestSelectorExecutionPlan}} limit is used to damp the cost which does not look right. E.g. limit is set to 10 and 2 plans with cost 190 and 110 are candidates, the plan ultimately selected out of the 2 after damping with the limit will be arbitrary (the first to be processed) as the actual estimated cost is effectively ignored.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)