[ 
https://issues.apache.org/jira/browse/OAK-1898?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14037208#comment-14037208
 ] 

Thomas Mueller commented on OAK-1898:
-------------------------------------

It would be great if we had a very rough estimate on the number of child nodes 
below a given path. One idea is: when adding a node, if Math.random() < 
0.00001, add a hidden, randomly named property (for example called ":count-xyz" 
where xyz is a uuid, value 100'000) to the parents of that node, so that we 
know there are probably more than 100'000 nodes below a given path. When 
removing a node, with the same algorithm add a hidden property (":count-xyz", 
value -100'000). That should result in a slowdown of less than 0.01%, but 
should allow us much better cost estimates. Those properties could be 
consolidated asynchronously if needed.

See also OAK-894, where a mechanism is described to track descendent node 
counts.


> Query: Incorrect cost calculation for traversal
> -----------------------------------------------
>
>                 Key: OAK-1898
>                 URL: https://issues.apache.org/jira/browse/OAK-1898
>             Project: Jackrabbit Oak
>          Issue Type: Bug
>          Components: query
>    Affects Versions: 1.0, 1.0.1
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>             Fix For: 1.1, 1.0.2
>
>         Attachments: [OAK][TraversingIndex] Incorrect cost calculation_.pdf
>
>
> For queries of the following type, the estimated cost of traversal is very 
> low if the number of path elements is high:
> {noformat}
> /jcr:root/path/with/many/elements/in/it//*
> {noformat}



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to