[SERVER-19593] Allow collscans on $snapshot queries when not using MMAP1 Created: 24/Jul/15  Updated: 22/Mar/17  Resolved: 06/Aug/15

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 3.0.0
Fix Version/s: 3.1.7

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Qingyang Chen
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
is depended on by SERVER-19781 QueryPlanner::plan() can sometimes bu... Closed
Related
is related to DOCS-7000 cursor.snapshot() page should no long... Closed
is related to SERVER-22214 CloneCollection with query doing COLL... Closed
is related to TOOLS-845 Mongodump very slow with custom _id Closed
Backwards Compatibility: Minor Change
Sprint: Quint Iteration 7
Participants:

 Description   

In MMAPv1 we need to scan the _id index to ensure we see documents once since records can move in the collection, allowing us to see duplicates or miss documents. In other storage engines this is not allowed, so we should be able to do table scans rather than index scans which can be orders of magnitude slower.

This would result in a user-facing change since we would no longer be returning documents in _id order, but that is not part of the documented behavior of $snapshot.



 Comments   
Comment by Githook User [ 27/Jan/16 ]

Author:

{u'username': u'ksuarz', u'name': u'Kyle Suarez', u'email': u'ksuarz@gmail.com'}

Message: DOCS-7000 no _id index scan for cursor.snapshot()

Due to SERVER-19593, the cursor.snapshot() method no longer forces an _id index
scan and instead performs a collection scan.

This removes the description of the implementation of cursor.snapshot(). It also
removes the extract isolate-cursor-snapshot-faq.

Signed-off-by: kay <kay.kim@10gen.com>
Branch: master
https://github.com/mongodb/docs/commit/ef3f09b9236684ddda0b9df50bfff3beb554af69

Comment by Githook User [ 06/Aug/15 ]

Author:

{u'username': u'coollog', u'name': u'Qingyang Chen', u'email': u'qingyang.chen@10gen.com'}

Message: SERVER-19593 snapshot default to collscan except when using MMAPv1
Branch: master
https://github.com/mongodb/mongo/commit/2830b503d24bd33077a4161e60ad4727972d5508

Comment by Qingyang Chen [ 28/Jul/15 ]

Method:
1) Add QueryPlannerParams parameter, SNAPSHOT_USE_IXSCAN, have snapshot do as before (index on _id) if isMMAPV1() (get_executor.cpp:fillOutPlannerParams)
2) Change snapshot() to default to be hint($natural) (code in QueryPlanner::plan)

Generated at Thu Feb 08 03:51:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.