[SERVER-12902] Equality queries on _id aren't covered Created: 25/Feb/14  Updated: 11/Jul/16  Resolved: 07/Mar/14

Status: Closed
Project: Core Server
Component/s: Querying
Affects Version/s: 2.6.0-rc0
Fix Version/s: 2.6.0-rc2

Type: Bug Priority: Major - P3
Reporter: J Rassi Assignee: Benety Goh
Resolution: Done Votes: 0
Labels: 26qa
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to SERVER-14304 Equality queries on _id with projecti... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Participants:

 Description   

Regression from 2.4. Presumably never implemented for the IDHack runner?

2.4.9:

> db.foo.find({_id:1},{_id:1}).explain()
{
	"cursor" : "BtreeCursor _id_",
	"isMultiKey" : false,
	"n" : 1,
	"nscannedObjects" : 0, // zero
	"nscanned" : 1,
	"nscannedObjectsAllPlans" : 0,
	"nscannedAllPlans" : 1,
	"scanAndOrder" : false,
	"indexOnly" : true,
	"nYields" : 0,
	"nChunkSkips" : 0,
	"millis" : 0,
	"indexBounds" : {
		"_id" : [
			[
				1,
				1
			]
		]
	},
	"server" : "Rassi-MacBook-Pro.local:27017"
}

2.6.0-rc0:

> db.foo.find({_id:1},{_id:1}).explain()
{
	"cursor" : "IDCursor",
	"n" : 1,
	"nscannedObjects" : 1, // not zero
	"nscanned" : 1,
	"millis" : 0,
	"indexBounds" : {
		"_id" : [
			[
				1,
				1
			]
		]
	},
	"server" : "Rassi-MacBook-Pro.local:27017"
}
>



 Comments   
Comment by Githook User [ 07/Mar/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12902 moved canUseIDHack from getRunner to IDHackRunner
Branch: master
https://github.com/mongodb/mongo/commit/1f5e07c9800532d623f1a4e5abed21744e8719d5

Comment by Githook User [ 07/Mar/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12902 extended ID hack to support {_id: 1} projection
Branch: master
https://github.com/mongodb/mongo/commit/8d72b72643249914a47df0dd95898f1916972620

Comment by Githook User [ 07/Mar/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12902 disallow queries with projections for id hack
Branch: master
https://github.com/mongodb/mongo/commit/b6b2fdf5c26db35a7553e8069816dc7c8d2c0a5b

Comment by Githook User [ 07/Mar/14 ]

Author:

{u'username': u'benety', u'name': u'Benety Goh', u'email': u'benety@mongodb.com'}

Message: SERVER-12902 number of required fields in parsed projection should be 1 when projecting {_id: 1}
Branch: master
https://github.com/mongodb/mongo/commit/3b7a5187d788daa0544fb967e48653398054ed22

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