jackrabbit-oak-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Mueller (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (OAK-2315) Index cost is sometimes negative
Date Wed, 03 Dec 2014 09:02:12 GMT

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

Thomas Mueller updated OAK-2315:
--------------------------------
    Component/s: query
                 core

> 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.2, 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)

Mime
View raw message