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

Marcel Reutegger commented on OAK-6165:
---------------------------------------

Queries on _sdType are not yet frequent, but will be when continuous revision 
GC is employed (OAK-3710). I have a test system running where I simulate this 
with the oak-run "revisions collect" command using the {{--continuous}} 
options. This command calls the revision GC every five seconds. On MongoDB it 
issues a query like this (among others) when the system is a two node cluster:

{noformat}
{
  $and: [ 
    { _sdType: { $exists: true } }, 
    { $or: [ 
      { _sdType: 50 }, 
      { _sdType: 60 }, 
      { _sdType: 70, 
        $and: [ { $or: [ { _id: /.*-1\/0/ }, { _id: /[^-]*/, _path: /.*-1\/0/ } 
] } ], 
        _sdMaxRevTime: { $lt: 1489069960 } }, 
      { _sdType: 70, 
        $and: [ { $or: [ { _id: /.*-2\/0/ }, { _id: /[^-]*/, _path: /.*-2\/0/ } 
] } ], 
        _sdMaxRevTime: { $lt: 1489069960 } } 
    ] }, 
    { _sdMaxRevTime: { $lt: 1489069960 } } 
  ] 
}
{noformat}

Without a compound index, the store is forced to scan all documents with an 
{{_sdType}} field. Running such a query on a moderately sized 1.6 repository 
(~60GB), leads to response times ranging from seconds to minutes, depending on 
how much page faulting is necessary. With a compound index in place, I get an 
instantaneous result.

> Create compound index on _sdType and _sdMaxRevTime (RDB)
> --------------------------------------------------------
>
>                 Key: OAK-6165
>                 URL: https://issues.apache.org/jira/browse/OAK-6165
>             Project: Jackrabbit Oak
>          Issue Type: Improvement
>          Components: rdbmk
>            Reporter: Chetan Mehrotra
>            Assignee: Julian Reschke
>             Fix For: 1.8
>
>
> Clone for OAK-6129 for RDB i.e. create index on OAK-6129on _sdType and 
> _sdMaxRevTime. This is required to run queries issued by the Revision GC 
> efficiently. 



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to