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 "Marcel Reutegger (JIRA)" <ji...@apache.org> on 2015/04/07 22:23:14 UTC

[jira] [Updated] (OAK-2315) Index cost is sometimes negative

     [ https://issues.apache.org/jira/browse/OAK-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marcel Reutegger updated OAK-2315:
----------------------------------
    Fix Version/s:     (was: 1.2)

> Index cost is sometimes negative
> --------------------------------
>
>                 Key: OAK-2315
>                 URL: https://issues.apache.org/jira/browse/OAK-2315
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: core, query
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>             Fix For: 1.0.9, 1.1.3
>
>
> The property index can return a negative cost in the following case:
> * It is a non-unique index (the default)
> * The "entryCount" is set to lower than 10000
> * The "keyCount" property is not set, or set to 0
> * The index matches
> In this case, the following formula is used and returns a negative value:
> {noformat}
> (long) ((double) count / keyCount) + size;
> {noformat}
> Count is for example 500, keyCount is 0. The division evaluates to infinity, which is converted to Long.MAX_VALUE. Size is larger than 0, so there is an overflow to negative.



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