-
Type: Improvement
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
For example, given a collection with 10k documents:
Mongo::QueryCache.enabled=true client['foo'].insert_many((1...10_000).map{|i|{test:i}})
If we perform a find with a 10k result set, but only retrieve 10 documents, the finds are currently not cached:
b=client['foo'].find.sort(test:1).to_enum 10.times { b.next } b=client['foo'].find.sort(test:1).to_enum 10.times { b.next }
Open questions:
- Should multi-batch finds this be cached when the cursor is not completely iterated?
- What if the first iteration completely consumes the first batch (i.e. iterates 1000 documents in default configuration instead of 10), should the second iteration read the 10 documents out of the cache populated by the first iteration?
If multi-batch queries are never cached, this should be noted in the user guide.