[CSHARP-886] Optimize numberToReturn for OP_GET_MORE based on the limit Created: 05/Jan/14  Updated: 02/Apr/15  Resolved: 13/Jan/14

Status: Closed
Project: C# Driver
Component/s: Performance
Affects Version/s: 1.8.3
Fix Version/s: 1.9

Type: Improvement Priority: Major - P3
Reporter: Jeffrey Yemin Assignee: Robert Stam
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

If an application requests a limit that turns out to be great than the number of documents returned from OP_QUERY, the driver should adjust the numberToReturn value for the OP_GET_MORE to ensure that no more documents are returned by the server than necessary. Example with a limit of 105:

  1. For OP_QUERY, set numberToReturn=105, and receive 101 documents in OP_REPLY (the driver already does this).
  2. For OP_GET_MORE, instead of setting numberToReturn=105, set it to 4.


 Comments   
Comment by Githook User [ 13/Jan/14 ]

Author:

{u'username': u'rstam', u'name': u'rstam', u'email': u'robert@10gen.com'}

Message: CSHARP-886: Use smallest possible numberToReturn in last GetMore message when Limit is used.
Branch: master
https://github.com/mongodb/mongo-csharp-driver/commit/4362388f17b76ab9036fd1198bbfc5bde60f3686

Generated at Wed Feb 07 21:38:06 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.