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 2017/02/08 10:06:41 UTC
[jira] [Updated] (OAK-2315) Index cost is sometimes negative (index
type "property")
[ https://issues.apache.org/jira/browse/OAK-2315?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Mueller updated OAK-2315:
--------------------------------
Summary: Index cost is sometimes negative (index type "property") (was: Index cost is sometimes negative)
> Index cost is sometimes negative (index type "property")
> --------------------------------------------------------
>
> 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.15#6346)