You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-dev@jackrabbit.apache.org by Chetan Mehrotra <ch...@gmail.com> on 2017/05/08 11:38:16 UTC

Re: svn commit: r1794332 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoMissingLastRevSeeker.java test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoMissingLastRevSeekerTest.java

On Mon, May 8, 2017 at 5:01 PM,  <mr...@apache.org> wrote:
> -        DBObject sortFields = new BasicDBObject(NodeDocument.MODIFIED_IN_SECS, -1);
> +        DBObject sortFields = new BasicDBObject(NodeDocument.MODIFIED_IN_SECS, 1);

May be we skip sorting altogether. In that case iteration would be on
id which should be stable order.

Chetan Mehrotra

Re: svn commit: r1794332 - in /jackrabbit/oak/trunk/oak-core/src: main/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoMissingLastRevSeeker.java test/java/org/apache/jackrabbit/oak/plugins/document/mongo/MongoMissingLastRevSeekerTest.java

Posted by Marcel Reutegger <mr...@adobe.com>.
On 08/05/17 13:38, Chetan Mehrotra wrote:
> On Mon, May 8, 2017 at 5:01 PM,  <mr...@apache.org> wrote:
>> -        DBObject sortFields = new BasicDBObject(NodeDocument.MODIFIED_IN_SECS, -1);
>> +        DBObject sortFields = new BasicDBObject(NodeDocument.MODIFIED_IN_SECS, 1);
>
> May be we skip sorting altogether. In that case iteration would be on
> id which should be stable order.

The _id index is not appropriate for this kind of query. The query is 
for documents that have been modified after a given timestamp. In almost 
all cases MongoDB will use the _modified+_id compound index. I wanted to 
leave the sort in there to make sure MongoDB scans the index in the 
correct sequence.

Regards
  Marcel