diff options
author | Aaron <aaron@10gen.com> | 2010-07-12 16:33:02 -0700 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2010-07-12 16:33:02 -0700 |
commit | d0ef8385751cc5e96b03ea4e7ae7ebc80003d60d (patch) | |
tree | 4fa97e919e7ab56fae5399e2b193a3a23271d4d8 /db/btreecursor.cpp | |
parent | 3e35041c3c59651e284ec309abceba74379a05ca (diff) | |
download | mongo-d0ef8385751cc5e96b03ea4e7ae7ebc80003d60d.tar.gz |
SERVER-1385 don't skip ahead when refinding position
Diffstat (limited to 'db/btreecursor.cpp')
-rw-r--r-- | db/btreecursor.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/db/btreecursor.cpp b/db/btreecursor.cpp index a4694d4e0da..3c8c8f44d8d 100644 --- a/db/btreecursor.cpp +++ b/db/btreecursor.cpp @@ -130,7 +130,7 @@ namespace mongo { } void BtreeCursor::skipAndCheck() { - skipUnusedKeys(); + skipUnusedKeys( true ); if ( !_independentFieldRanges ) { checkEnd(); return; @@ -140,14 +140,14 @@ namespace mongo { break; } while( skipOutOfRangeKeysAndCheckEnd() ); - if ( !skipUnusedKeys() ) { + if ( !skipUnusedKeys( true ) ) { break; } } } /* skip unused keys. */ - bool BtreeCursor::skipUnusedKeys() { + bool BtreeCursor::skipUnusedKeys( bool mayJump ) { int u = 0; while ( 1 ) { if ( !ok() ) @@ -158,7 +158,7 @@ namespace mongo { break; bucket = b->advance(bucket, keyOfs, direction, "skipUnusedKeys"); u++; - if ( u % 10 == 0 ) { + if ( mayJump && ( u % 10 == 0 ) ) { skipOutOfRangeKeysAndCheckEnd(); } } @@ -316,7 +316,7 @@ namespace mongo { /* we were deleted but still exist as an unused marker key. advance. */ - skipUnusedKeys(); + skipUnusedKeys( false ); } return; } @@ -340,7 +340,7 @@ namespace mongo { bucket = indexDetails.head.btree()->locate(indexDetails, indexDetails.head, keyAtKeyOfs, _ordering, keyOfs, found, locAtKeyOfs, direction); RARELY log() << " key seems to have moved in the index, refinding. found:" << found << endl; if ( ! bucket.isNull() ) - skipUnusedKeys(); + skipUnusedKeys( false ); } |