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

Marcel Reutegger resolved OAK-3071.
-----------------------------------
       Resolution: Fixed
    Fix Version/s:     (was: 1.4)

Changing the query unfortunately does not help. In some cases neither the index 
on _id nor _modified is selective. This may happen when the async indexer lags 
behind and a node with many child nodes needs to be compared between two 
revisions.

On startup MongoDocumentStore now creates a compound index on _modified and _id 
when the nodes collection is empty. When Oak is upgraded to 1.4, a warn message 
is logged and instructs the user to manually create the compound index.

MongoDocumentStore automatically disables the use of an index hint in case the 
new compound index is present.

Implemented in trunk: http://svn.apache.org/r1728123

> Add a compound index for _modified + _id
> ----------------------------------------
>
>                 Key: OAK-3071
>                 URL: https://issues.apache.org/jira/browse/OAK-3071
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: mongomk
>            Reporter: Chetan Mehrotra
>            Assignee: Marcel Reutegger
>            Priority: Blocker
>              Labels: performance, resilience
>             Fix For: 1.3.15
>
>
> As explained in OAK-1966 diff logic makes a call like
> bq. db.nodes.find({ _id: { $gt: "3:/content/foo/01/", $lt: 
> "3:/content/foo010" }, _modified: { $gte: 1405085300 } }).sort({_id:1})
> For better and deterministic query performance we would need to create a 
> compound index like \{_modified:1, _id:1\}. This index would ensure that 
> Mongo does not have to perform object scan while evaluating such a query.
> Care must be taken that index is only created by default for fresh setup. For 
> existing setup we should expose a JMX operation which can be invoked by 
> system admin to create the required index as per maintenance window



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

Reply via email to