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 "Thomas Mueller (JIRA)" <ji...@apache.org> on 2013/09/23 14:49:02 UTC

[jira] [Created] (OAK-1035) Property Index: cost calculation is wrong (zero) when searching for many values

Thomas Mueller created OAK-1035:
-----------------------------------

             Summary: Property Index: cost calculation is wrong (zero) when searching for many values
                 Key: OAK-1035
                 URL: https://issues.apache.org/jira/browse/OAK-1035
             Project: Jackrabbit Oak
          Issue Type: Bug
          Components: query
            Reporter: Thomas Mueller
            Assignee: Thomas Mueller


Currently, for queries of the form 

{code}
select * from [nt:unstructured] where type = 'xyz'
{code}

the node type index is used in some cases, even if there is an index on the property "type". The reason is that the cost for the node type index is 0 due to a bug. The node type index internally uses the property index on the property "jcr:primaryType", and asks for the cost using all possible children node types of "nt:unstructured". The returned cost is 0 because of this bug. The cost estimation is an extrapolation of the number of entries for the first 3 values. It is currently coded as:

{code}
count = count / size / i;
{code}

when in fact it should be written as:

{code}
count = count * size / i;
{code}


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira