diff options
author | Antonin Kral <a.kral@bobek.cz> | 2012-05-10 06:57:57 +0200 |
---|---|---|
committer | Antonin Kral <a.kral@bobek.cz> | 2012-05-10 06:57:57 +0200 |
commit | 8813daaab256108f7aa6300875e8562d031f2c2f (patch) | |
tree | 06daade9022f76b2775d23f4613817365a2ded99 /client/parallel.cpp | |
parent | d72a59184a3d51b17b30ed20fe656421bd4d2248 (diff) | |
parent | 61619b3142c1de8f60f91964ff2656054d4f11a6 (diff) | |
download | mongodb-8813daaab256108f7aa6300875e8562d031f2c2f.tar.gz |
Merge tag 'upstream/2.0.5'
Upstream version 2.0.5
Diffstat (limited to 'client/parallel.cpp')
-rw-r--r-- | client/parallel.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/client/parallel.cpp b/client/parallel.cpp index 3a33eb5..d7975a6 100644 --- a/client/parallel.cpp +++ b/client/parallel.cpp @@ -503,7 +503,19 @@ namespace mongo { 0 , // nToSkip _fields.isEmpty() ? 0 : &_fields , // fieldsToReturn _options , - _batchSize == 0 ? 0 : _batchSize + _needToSkip // batchSize + // NtoReturn is weird. + // If zero, it means use default size, so we do that for all cursors + // If positive, it's the batch size (we don't want this cursor limiting results), tha + // done at a higher level + // If negative, it's the batch size, but we don't create a cursor - so we don't want + // to create a child cursor either. + // Either way, if non-zero, we want to pull back the batch size + the skip amount as + // quickly as possible. Potentially, for a cursor on a single shard or if we keep be + // chunks, we can actually add the skip value into the cursor and/or make some assump + // return value size ( (batch size + skip amount) / num_servers ). + _batchSize == 0 ? 0 : + ( _batchSize > 0 ? _batchSize + _needToSkip : + _batchSize - _needToSkip ) // batchSize ) ); try{ |