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 "Justin Edelson (JIRA)" <ji...@apache.org> on 2014/06/16 17:04:02 UTC

[jira] [Comment Edited] (OAK-1894) PropertyIndex only considers the cost of a single indexed property

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

Justin Edelson edited comment on OAK-1894 at 6/16/14 3:03 PM:
--------------------------------------------------------------

Patch which calculates the cheapest property and uses it. It also outputs significantly more diagnostic information so that you can see the cost per property (even though only one of those properties, the cheapest, will be used for the actualy query).

The only thing I dislike about this approach is that the cost calculation can happen multiple times per query. However, I don't see a way around this without refactoring of the API to allow indexes to return an object from getCost() which can then be passed into query() later.


was (Author: justinedelson):
Patch which calculates the cheapest property.

> PropertyIndex only considers the cost of a single indexed property
> ------------------------------------------------------------------
>
>                 Key: OAK-1894
>                 URL: https://issues.apache.org/jira/browse/OAK-1894
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: query
>            Reporter: Justin Edelson
>         Attachments: OAK-1894.patch
>
>
> The existing PropertyIndex loops through the PropertyRestriction objects in the Filter and essentially only calculates the cost of the first indexed property. This isn't actually the first property in the query and Filter.propertyRestrictions is a HashMap.
> More confusingly, the plan for a query with multiple indexed properties outputs *all* indexed properties, even though only the first one is used.
> For queries with multiple indexed properties, the cheapest property index should be used in all three relevant places: when calculating the cost, when executing the query, and when producing the plan.



--
This message was sent by Atlassian JIRA
(v6.2#6252)