diff options
author | Eliot Horowitz <eliot@10gen.com> | 2009-10-05 16:39:49 -0400 |
---|---|---|
committer | Eliot Horowitz <eliot@10gen.com> | 2009-10-19 17:38:45 -0400 |
commit | 8c29986cf7372fe8008675bbc42a83ecec32e226 (patch) | |
tree | c4dacbcf1be92c8302a0948c526e1c7fbaaa3527 | |
parent | 1a4490dbba239189489c8630ad8da27a95cf0c2d (diff) | |
download | mongo-8c29986cf7372fe8008675bbc42a83ecec32e226.tar.gz |
make getMore buffer big since we know there are lots of results
-rw-r--r-- | db/query.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/db/query.cpp b/db/query.cpp index 7fdf3197bdd..baa82c7102f 100644 --- a/db/query.cpp +++ b/db/query.cpp @@ -907,9 +907,14 @@ namespace mongo { } QueryResult* getMore(const char *ns, int ntoreturn, long long cursorid) { - BufBuilder b(32768); - ClientCursor *cc = ClientCursor::find(cursorid); + + int bufSize = 512; + if ( cc ){ + bufSize += sizeof( QueryResult ); + bufSize += ( ntoreturn ? 4 : 1 ) * 1024 * 1024; + } + BufBuilder b( bufSize ); b.skip(sizeof(QueryResult)); |