[
https://issues.apache.org/jira/browse/OAK-1902?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14041842#comment-14041842
]
Thomas Mueller commented on OAK-1902:
-------------------------------------
Yes, those magic numbers are really bad. Sorry I didn't document the number.
The 10'000 means, by default it is assumed that each key contains 10'000
values. It needs to be about 10'000 so that the nodetype index is used but not
traversal, and a property index and not the nodetype index. Those are all
"rules", which we should avoid. We don't want a rule-based optimizer, we want a
cost-based optimizer. But we can't actually estimate the cost currently. For
that, we really need to solve OAK-1907, so that the magic numbers, and the
manual "entryCount" setting are no longer needed.
The problem with your patch is that it's quite large, and didn't have special
(JCR level) test case. Now we do have a test case, and of course we can look at
the patch again. Should I create a new issue?
> NodeTypeIndex is not conversative enough about its cost
> -------------------------------------------------------
>
> Key: OAK-1902
> URL: https://issues.apache.org/jira/browse/OAK-1902
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: query
> Affects Versions: 1.0, 1.0.1
> Reporter: Justin Edelson
> Assignee: Thomas Mueller
> Fix For: 1.1, 1.0.2
>
> Attachments: OAK-1902-b.patch, OAK-1902-c.patch, OAK-1902.patch
>
>
> NodeTypeIndexProvider derives its cost from PropertyIndexLookup.
> PropertyIndexLookup has a hardcoded maximum cost (which actually isn't a
> maximum cost, but is more the maximum number of nodes which will be read
> during cost calcuation).
> IMHO, these maximum costs should not be the same. In my experience with
> JCR-based applications, the number of matches for a particular node type is
> far greater than the number of matches for a regular property value.
> As a result, I would suggest that if the maximum cost is reached, a greater
> penalty should be applied to a node type index than a regular property index.
--
This message was sent by Atlassian JIRA
(v6.2#6252)